Snippets Collections
let arr = []; 
for (let i = 0; i <20; i++) {
    let rand = Math.floor(Math.random() * 10) + 1
    arr[i] = rand;
}
console.log(arr)

let evenNumbersArray = [];
let oddNumbersArray = [];
for (let i of arr) {
    if (value % 2 == 0) {
        evenNumbersArray += value
    } else
     {
         oddNumbersArray += value
     }
}
let sum=null;
for (let i=0; i < 10; i++) {
let value = +prompt("enter a number:", ''); 
if (!value || value >10) {
    break
}
sum += value;
console.log(sum);
}
let sum = 0; 
while (true) {
    let value = +prompt("Enter the number", '');
    if (!value) {
        break
    }
    sum += value;
}
console.log('Sum:',+ sum)
Object.prototype.obCustom = function(a,b) {
    return (a+b);
};
Array.prototype.arrCustom = function() {}; 

const iterable = [3,4,7, test = {name: 'asasas'}]; 
iterable.foo ='hello'; 

for (const i in iterable) {
    console.log(i)

    for (const i of iterable) {
        console.log(i)

        Object.prototype.objCustom = function(a,b) {
            return a+b; 
        }
    }
}

server229.web-hosting.com
benjmubr
star

Thu Apr 29 2021 18:23:18 GMT+0000 (UTC)

#ftp
star

Thu Apr 29 2021 18:06:51 GMT+0000 (UTC)

#ftp
star

Thu Apr 29 2021 17:26:50 GMT+0000 (UTC)

#ftp
star

Thu Apr 29 2021 17:23:37 GMT+0000 (UTC)

#ftp
star

Sun Apr 25 2021 22:45:05 GMT+0000 (UTC)

#ftp

Save snippets that work with our extensions

Available in the Chrome Web Store Get Firefox Add-on Get VS Code extension