What do you want to save?
Add Code snippet
New code examples
-
-
Javascript 2021-10-26 23:52:05
browser js assert
// Failed assertions to not error out of functions: function f() { console.log("A") console.assert(2 + 2 === 4) console.log("B") console.assert(2 + 2 == 5) console.log("C") } f() // A // B // Assertion fai... Add solution -
Javascript 2021-10-26 02:28:08
Npx async fetch() {
async fetch() { const article = await fetch( `https://dev.to/api/articles/${this.$route.params.article}` ).then((res) => res.json()) if (article.id && article.user.username === this.$route.params.username) { this.article = articl... Add solution -
Javascript 2021-10-15 00:16:08
javascript ean13 checksum generate
function getLastEan13Digit(ean) { if (!ean || ean.length !== 12) throw new Error('Invalid EAN 13, should have 12 digits'); const multiply = [1, 3]; let total = 0; ean.split('').forEach((letter, index) => { total += parseInt(letter, 10)... Add solution -