js_array_helper
Creating new additional methods for array in js
To use:
- Download the js_array_helper.js file
- include in your script like <script src="js_array_helper.js" type="text/javascript"></script>
Methods:
-
first() - Returns the first value of the array e.g. var arr = ['foo', 'bar']; arr.first() will return 'foo'
-
last() - Returns the last value of the array e.g. var arr = ['foo', 'bar']; arr.last() will return 'bar'