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
'use strict' | |
var arr = new Array(100).fill(0).map((e, i) => i) | |
var res = 0 | |
function myFor (arr) { | |
var tempSum = 0 | |
for (let j = 0; j < 10_000_000; j++) { | |
for (let index = 0; index < arr.length; index++) { | |
tempSum += arr[index] | |
} |
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
var arr = new Array(100).fill(0).map((e, i) => i); | |
var res = 0 | |
function myFor(arr) { | |
for (let j = 0; j < 10_000_000; j++) { | |
for (let index = 0; index < arr.length; index++) { | |
res += arr[index]; | |
} | |
} | |
} |
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
'use strict'; | |
// find first letter of the word | |
const getFirstLetter = (word = '') => word[0]; | |
// find last letter of the word | |
const getLastLetter = (word = '') => word[word.length - 1]; | |
// test whether last letter of first word equal to first letter of second word | |
const testWords = (word1, word2) => getLastLetter(word1) === getFirstLetter(word2); | |
// test whether array is valid chain of millipede words | |
const testArray = (array) => { |
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 greet = () => { | |
const L = (x) => - | |
( 1699 / 831600 * x ** 11) + | |
( 37339 / 302400 * x ** 10) - | |
( 589129 / 181440 * x ** 9) + | |
( 1965121 / 40320 * x ** 8) - | |
( 17402561 / 37800 * x ** 7) + | |
( 20479411 / 7200 * x ** 6) - | |
( 233153797 / 20160 * x ** 5) + | |
( 3667222847 / 120960 * x ** 4) - |