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
/*----------------------------------------------------------------------------- | |
1.reverse every word in the sentence. | |
2.the orders between words do not change. | |
the reference used at the second function is from UdemyCourse: LearningAlgorithmsInJavascriptFromScratch | |
-----------------------------------------------------------------------------*/ | |
function reverseWords(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
/*----------------------------------------------------------------------------- | |
1.turn every word into another word by the same process. | |
2.just like a puzzle | |
3.the map() method need to assigned to a variable. | |
the reference is by me, oh yah. | |
-----------------------------------------------------------------------------*/ | |
function caesarCipher(str, num) { | |
arr = str.split(""); |
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
/*----------------------------------------------------------------------------- | |
1.check if the string that reversed is as same as the origin. | |
2.ignoring the situation like upper or lower, and punctuation. | |
the reference used at the second function is from UdemyCourse: LearningAlgorithmsInJavascriptFromScratch | |
-----------------------------------------------------------------------------*/ | |
function isPalindrome(string) { | |
var reg = /[a-z]/g; | |
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
/*----------------------------------------------------------------------------- | |
1.check if the 1st argument's words is existing at the 2nd argument. | |
2.the function is used to check if the latter is more apples than the former. | |
the reference is from UdemyCourse: LearningAlgorithmsInJavascriptFromScratch | |
-----------------------------------------------------------------------------*/ | |
/******************************************* | |
NOTES:Time complexity, Big O notation() |
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
/*----------------------------------------------------------------------------- | |
1.check the multiple | |
2.the fifteen's case must be first. | |
the reference is from UdemyCourse: LearningAlgorithmsInJavascriptFromScratch | |
-----------------------------------------------------------------------------*/ | |
// 15X ->> 'FizzBuzz' | |
// 5X ->> 'buzz' | |
// 3X ->> 'fizz' | |
function fizbuz(n) { |
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
Name Character Entity | |
Copyright © © | |
Registered ® ® | |
Trademark ™ ™ | |
Curly Open Double Quote “ “ | |
Curly Closed Double Quote ” ” | |
Curly Open Single Quote ‘ ‘ | |
Curly Closed Single Quote ’ ’ | |
Big Bullet/Dot • • |
NewerOlder