Quotes help make search much faster. Example: "Practice Makes Perfect"

Thursday, December 6, 2012

Codecademy: Codeyear Extending Strings


//sample solution


var str1 = "It was the best of times";
var str2 = "It was the worst of times";

// extend String's prototype here
String.prototype.futureDickens = function(){
return this.toString().replace("was","will be");
};

console.log( str1.futureDickens() );
console.log( str2.futureDickens() );

No comments:

Post a Comment


This is an example of scrolling text using Javascript.

Popular Posts