This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.blurred-circle { | |
animation: 3s blured-move linear infinite; | |
} | |
@keyframes blured-move { | |
from { | |
transform: rotate(0deg) translateX(2vmax) rotate(0deg); | |
} | |
to { | |
transform: rotate(-360deg) translateX(2vmax) rotate(360deg); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
return s.replace(/AM|PM/,'').split(':').map((v,i)=>i==0?/AM/.test(s)?v==12?'00':v:v==12?v:+v+12:v).join(':'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
string.replace(param1, param2); | |
// param1 - RegExp or String | |
// param2 - String or Function(return String) | |
// EXAMPLE | |
'ABC'.replace(/A/, 'X'); // XBC |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
string.split([param1[, param2]]); // All params are optional | |
// param1 - String or RegExp | |
// param2 - Number | |
// EXAMPLE | |
'ABCDEF'.split(); // ['ABCDEF'] | |
'ABCDEF'.split('CD'); // ['AB', 'EF'] | |
'ABCDEF'.split('CD', 1); // ['AB'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
array.map(param1[, param2]); | |
// param1 - Function(value, index, array) | |
// param2 - Object (to bind as this) | |
// EXAMPLE | |
[1, 2, 3, 4, 5].map((val, i, arr) => { | |
if (arr[i] === val) // always true | |
return val + i; | |
}); // [1, 3, 5, 7, 9] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
regexp.test(param); | |
// param - String or Function(return String) | |
//EXAMPLE | |
/ABC/.test('ABCDEF'); // true | |
/ABC/.test('ABODEF'); // false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let sum = arr.reduce((p, c) => p + c, 0); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
array.reduce(param1[, param2]); | |
// param1 - Function(accumulator, currentValue, index, array) | |
// param2 - accumulator's initial value | |
// EXAMPLE | |
[1, 2, 3, 4, 5].reduce((acc, val, i) => { | |
return acc += val; | |
}, 0); // 15 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
return `${sum - Math.max(...arr)}, ${sum - Math.min(...arr)}`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const array = [1, 2, 3]; | |
function sum(a, b, c) { | |
return a + b + c; | |
} | |
sum(1, 2, 3); // 6 | |
sum(...array); // = sum(...[1, 2, 3]) = sum(1, 2, 3) -> 6 |