802Objects and Key Array Length in Javascript

With arrays is trivial to get the length, with objects, the situations is slightly different. One approach would be to get all the keys and get the length of that array:
Object.keys(myObject).length;
More details at Stackoverflow. This functionality is part of EMCAScript 5 specs.

785Filtering Arrays with ECMAScript 5 and filter()

Suppose you have an array of object:
var array = [ 	{a:13, b:false },
		{a:7, b:true },
		{a:78, b:true } ]		
The old, ECMAScript 3 way of checking for objects, in which b is true would be a simple for-loop:
var results = [];
for (var i=0; i

Ok, that's working, but not very elegant nor concise. Luckily, ECMAScript 5 offers a nicer way:

var results = array.filter( function(item) {
	return item.b;		// if item.b is true
});