adding Array prototype method from jsfiddle