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
Examples: | |
------------------------------------------------------------ | |
Split and loop method: | |
------------------------------------------------------------ | |
function titleCase(str) { | |
var newstr = str.split(" "); | |
for(i=0;i<newstr.length;i++){ | |
if(newstr[i] == "") continue; | |
var copy = newstr[i].substring(1).toLowerCase(); |
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
One of the simplest and most widely known ciphers is a Caesar cipher, also known as a shift cipher. In a shift cipher the meanings of the letters are shifted by some set amount. | |
A common modern use is the ROT13 cipher, where the values of the letters are shifted by 13 places. Thus 'A' ↔ 'N', 'B' ↔ 'O' and so on. | |
A ROT13 encoded string takes user input and returns a decoded strings in the following | |
* All letters will be uppercase. | |
* Do not transform any non-alphabetic character (i.e. spaces, punctuation), but do pass them on. | |
* Remember to use Read-Search-Ask if you get stuck. Try to pair program. Write your own code. | |
String.prototype.charCodeAt() |
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
const captcha = "29917128875332952564321392569634257121244516819997569284938677239676779378822158323549832814412597817651244117851771257438674567254146559419528411463781241159837576747416543451994579655175322397355255587935456185669334559882554936642122347526466965746273596321419312386992922582836979771421518356285534285825212798113159911272923448284681544657616654285632235958355867722479252256292311384799669645293812691169936746744856227797779513997329663235176153745581296191298956836998758194274865327383988992499115472925731787228592624911829221985925935268785757854569131538763133427434848767475989173579655375125972435359317237712667658828722623837448758528395981635746922144957695238318954845799697142491972626942976788997427135797297649149849739186827185775786254552866371729489943881272817466129271912247236569141713377483469323737384967871876982476485658337183881519295728697121462266226452265259877781881868585356333494916519693683238733823362353424927852348119426673294798416314637799636344448941782774113142 |
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
/* | |
ORIGINAL OO CODE: | |
var Vehicle = function (x, y, speed) { | |
this.x = x; | |
this.y = y; | |
this.speed = speed; | |
}; | |
Vehicle.prototype.move = function() { | |
this.x = this.x + this.speed * this.randomStep(); |
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
<p></p> | |
<p class="move-right"></p> | |
<p></p> | |
<p class="move-down"></p> |
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
<p class="box">NO TRANSITION</p> | |
<p class="animated box">TRANSITION</p> | |
<p class="crazy box">CRAZINESS</p> |
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
<p class="box">BORING</p> | |
<p class="animated box">ANIMATED</p> |
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
<p>HELLO!</p> | |
<p>HELLO!</p> |
OlderNewer