This file contains 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
Object.prototype.toString.call([]) === "[object Array]" |
This file contains 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
myObject.getName.apply(otherObject, [args]); |
This file contains 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
Array.prototype.slice.call(arguments, 1); |
This file contains 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
// Our iterator | |
var iterator = (function() { | |
var index = -1, | |
// Our data | |
data = ['joe', 'chapman', 'developer', 'UK'], | |
// cache the length | |
length = data.length; | |
return { |
This file contains 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
var count = function(obj) { | |
var size = 0, key; | |
for (key in obj) { | |
size++; | |
} | |
return size; | |
}; |
This file contains 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
var getItem = function(obj, i) { | |
var key, arr = []; | |
for (key in obj) { | |
arr.push(obj[key]); | |
} | |
return arr[i]; | |
}; |
This file contains 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
length = data.length ? data.length : count(data); | |
next: function() { | |
if (!this.hasNext()) { | |
return null; | |
} | |
index = index + 1; | |
if (data[index] !== undefined) { | |
return data[index]; | |
} |
This file contains 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
var count = function(obj) { | |
var size = 0, key; | |
for (key in obj) { | |
size++; | |
} | |
return size; | |
}; | |
var getItem = function(obj, i) { | |
var key, arr = []; |
This file contains 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
var data = { | |
"package_all" : { | |
"TV": true, | |
"Broadband": true, | |
"Talk": true | |
} | |
} |
This file contains 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
<div> | |
<p>You selected:</p> | |
</div> |
OlderNewer