Blog

JavaScript Quirks – Array Slicing Node Lists

For a while many developers, including myself, suggested that Array.prototype.slice() be used to turn any array-like object into an array. Recently, I was alerted to a scenario in which this does not work as expected. Let’s take the following code for example: var elems = document.body.getElementsByTagName('*'); var arrElems = Array.prototype.slice.call(elems, Read more…

By Chris West, ago
Blog

Excel – Multi-column VLookup

When analyzing data in Excel at times it is necessary to pull data from another data source based on more than one column. In this case you can use the MATCH function in an array formula. Just so you understand the general idea of an array, it is a collection Read more…

By Chris West, ago
Blog

PHP – Foreach By Reference

Today I was writing some code in which I wanted to modify the values of an array within a for-loop. The obvious solution would be to use the key to modify the value but there is actually another way of doing it: $arr = array(1,2,3,4,5); foreach ($arr as &$value) { Read more…

By Chris West, ago