Skip to content

Instantly share code, notes, and snippets.

View iamricky's full-sized avatar

Ricky iamricky

View GitHub Profile
@iamricky
iamricky / inheritance.md
Created August 27, 2014 01:45
Inheritance in JS

Inheritance

function Animal(name){
   this.name = name;
}
Animal.prototype.talk = function(){
   console.log(this.phrase);
}
@iamricky
iamricky / RegExpPatterns.md
Created August 27, 2014 01:27
RegExp in JS

RegExp

var pattern = new RegExp('javascript','i');
//or 
var pattern = /javascript/i;

Patterns can be used as follows

http://nicksda.apotomo.de/2011/10/rails-misapprehensions-helpers-are-shit