/js_array_helper

Creating new additional methods for array in js

Primary LanguageJavaScriptMIT LicenseMIT

js_array_helper

Creating new additional methods for array in js

To use:

  1. Download the js_array_helper.js file
  2. include in your script like <script src="js_array_helper.js" type="text/javascript"></script>

Methods:

  1. first() - Returns the first value of the array e.g. var arr = ['foo', 'bar']; arr.first() will return 'foo'

  2. last() - Returns the last value of the array e.g. var arr = ['foo', 'bar']; arr.last() will return 'bar'