Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 
avatar of caub

caub

caub has asked 1 questions and find answers to 6 problems.

Stats

165
EtPoint
62
Vote count
1
questions
6
answers

About

var digest = (a,x) => a+x.replace(/\w/g, i=>Math.random()<.2?i:'');

['peach', 'tomato', 'fig'].reduce(digest)


// safe:) addition function
var safeAdd = (a,b,i=100) => Number(eval(`${`\`\${`.repeat(i)}${a}+${b}${`}\``.repeat(i)}`));
safeAdd(1,2) // 3

// other one:
var coolAdd = async (a,b) => await a + await new Promise(r=>setTimeout(r, 5000, b));
await coolAdd(2,3) // 5

var pi=Promise.reject('🐱'), u=console.log; pi.catch(u);

Math.sign(in); Math.log(out);