http://www.unheap.com http://plugins.jquery.com http://www.jsdb.io http://microjs.com http://www.jqueryrain.com Do I missing something? Yes, for sure!. Please send me your links to: developer@leolanese.com
Creating Objects on JS
There are few interesting ways to create Objects on JS Creating Objects on JS Constructor function (classical inheritance pattern)
1 |
function myObject(){}; |
Literal notation (prototypal inheritance pattern)
1 |
var myObject={}; |
Object-Based (ES5)
1 |
Object.create() |
DEFINING Methods and Properties: Constructor Way
1 2 3 4 5 6 |
function myObject(){ this.iAm = 'an Object'; this.iAmFun = function(){ alert('this.iAm') } } |
Literal Way
1 2 3 4 5 6 |
var myObject = { iAm: 'an Object', iAmFun: function(){ alert(this.iAm); } } |
Object-basedRead more…