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 todoList = { | |
todos: [], | |
addTodo: function(e) { | |
this.todos.push({ | |
todoText: e, | |
completed: !1 | |
}) | |
}, | |
changeTodo: function(e, t) { | |
this.todos[e].todoText = t |
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
function largestOfEachSubarray(r) { | |
for (i = 0; i < r.length; i++) { | |
var a = r[i], | |
n = 0; | |
for (j = 0; j < a.length; j++) { | |
var t = a[j]; | |
n < t && (n = t) | |
} | |
r[i] = n | |
} |
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
function titleCase(t) { | |
for (t = t.toLowerCase().split(" "), i = 0; i < t.length; i++) t[i] = t[i].split(""), t[i][0] = t[i][0].toUpperCase(), t[i] = t[i].join(""); | |
return t = t.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
function findLongestWord(n) { | |
n = n.split(" "); | |
var t = 0; | |
for (i = 0; i < n.length; i++) t < n[i].length && (t = n[i].length); | |
return t | |
} |
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
function palindrome(e) { | |
var r = e = e.toLowerCase().replace(/[^a-z0-9]/g, ""); | |
return r === r.split("").reverse().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
function factorialize(r) { | |
if (r < 0) return "Your input is garbage!"; | |
if (0 === r) return 1; | |
for (var i = r; i > 1;) r *= --i; | |
return r | |
} |
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
function reverseString(e) { | |
return e.split("").reverse().join("") | |
} |
NewerOlder