This file contains hidden or 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
function rowSumOddNumbers(n) { | |
let startValue = n * (n - 1) + 1; | |
let sum = 0; | |
for (let i = 1; i <= n; i++) { | |
if (i == 1) { | |
sum = startValue | |
} else { | |
startValue = startValue + 2; | |
sum = sum + startValue; | |
} |
This file contains hidden or 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
function openOrSenior(data) { | |
const newData = data.map((item) => { | |
if (item[0] >= 55 && item[1] > 7) { | |
return 'Senior' | |
} else { | |
return 'Open' | |
} | |
}); | |
return newData; | |
} |
This file contains hidden or 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
function reverseString(str){ | |
let reverse = ""; | |
for (let a = str.length - 1; a >= 0; a--){ | |
reverse = reverse + str[a]; | |
} | |
return reverse; | |
} | |
console.log(reverseString("World")); |
This file contains hidden or 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
{"lastUpload":"2021-03-12T12:36:27.295Z","extensionVersion":"v3.4.3"} |