25 mins with 5 mins break
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
| Random Quote generator | |
| ---------------------- | |
| A [Pen](http://codepen.io/Dragonza/pen/RWVYYj) by [Alex ](http://codepen.io/Dragonza) on [CodePen](http://codepen.io/). | |
| [License](http://codepen.io/Dragonza/pen/RWVYYj/license). |
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
| <form class="search-form"> | |
| <input type="text" class="search" placeholder="City or State"> | |
| <ul class="suggestions"> | |
| <li>Filter for a city</li> | |
| <li>or a state</li> | |
| </ul> | |
| </form> |
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 reverse(str) { | |
| return str.split('').reduce((rev, char) => char + rev, '') | |
| } |
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 reverse(str) { | |
| return str.split('').reverse().join(''); | |
| } |
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 reverse(str) { | |
| let reverseString = ''; | |
| for (let character of str) { | |
| reverseString = character + reverseString; | |
| } | |
| return reverseString; | |
| } |
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 reverse(str) { | |
| let reversed = ''; | |
| for (var i = str.length - 1; i >= 0; i--) { | |
| reversed += str[i]; | |
| } | |
| return reversed; | |
| } |
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 palindrome(str) { | |
| const reversed = str.split('').reverse().join(''); | |
| return str === reversed; | |
| } |
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 palindrome(str) { | |
| const arr = str.split(''); // turn a string in to an array of characters | |
| return arr.every((char, i) => char === str[str.length - 1 - i]); // return true if all elements in the array pass the test implemented by the provided function. | |
| } |
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 palindrome(str) { | |
| for (var i = 0; i < str.length / 2; i++) { | |
| if (str[i] !== str[str.length - 1 -i]) { | |
| return false; | |
| } | |
| } | |
| return true; | |
| } |
OlderNewer