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(str) { | |
// Good luck! | |
var datArray = []; | |
var blank = []; | |
var isItPalin = ""; | |
datArray = str.split(""); | |
blank = datArray.reverse(); | |
isItPalin = blank.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
// Setup | |
var collection = { | |
2548: { | |
album: "Slippery When Wet", | |
artist: "Bon Jovi", | |
tracks: [ | |
"Let It Rock", | |
"You Give Love a Bad Name" | |
] | |
}, |
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 nextInLine(arr, item) { | |
// Your code here | |
var first = arr[0]; | |
arr.push(item); | |
arr.shift(); | |
return first; // Change this line | |
} | |
// Test Setup | |
var testArr = [1,2,3,4,5]; |