Skip to content

Instantly share code, notes, and snippets.

View kepta's full-sized avatar
🐒
What

Kushan Joshi kepta

🐒
What
  • Toronto
View GitHub Profile
@kepta
kepta / kj
Created December 12, 2020 08:14
sdsd

The Draft library includes default block CSS styles within DraftStyleDefault.css. (Note that the annotations on the CSS class names are artifacts of Facebook's internal CSS module management system.) skdlsa saljdlaskd

Promising Promise Tips

Promises are great to work with! Or so does your fellow developer at work says.

prom

This article would give you to the point no bullshit tips on how to improve your relationship with the Promises.

You can return a Promise inside a .then

function sayHi() {
var allNames = [];
var emoji = '👋';
return name => {
allNames.push(name);
return emoji + name;
}
}
function sayHi() {
var allNames = [];
var emoji = '👋';
return name => {
allNames.push(name);
return emoji + name;
}
}
var x = [ [1] ];
for(var i = 1; i < 100000; i++) {
x.push(arrayAddFirst(i, x[i-1])); // Warning! do not try this at home
}
var x = 0;
while(x < 5) {
console.log(x); // Warning! do not try this at home
}
@kepta
kepta / memory-3.js
Last active February 5, 2018 05:12
for(var i = 0; i < newData.length; i++) {
for(var j = 0; j < i; j++) {
// stuff here
}
}
result = newData.reduce((p,r) => arrayAddFirst(r, p), []);