summaryrefslogtreecommitdiff
path: root/node_modules/locutus/php/array/pos.js
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/locutus/php/array/pos.js')
-rw-r--r--node_modules/locutus/php/array/pos.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/node_modules/locutus/php/array/pos.js b/node_modules/locutus/php/array/pos.js
new file mode 100644
index 0000000..424fd35
--- /dev/null
+++ b/node_modules/locutus/php/array/pos.js
@@ -0,0 +1,14 @@
+'use strict';
+
+module.exports = function pos(arr) {
+ // discuss at: http://locutus.io/php/pos/
+ // original by: Brett Zamir (http://brett-zamir.me)
+ // note 1: Uses global: locutus to store the array pointer
+ // example 1: var $transport = ['foot', 'bike', 'car', 'plane']
+ // example 1: pos($transport)
+ // returns 1: 'foot'
+
+ var current = require('../array/current');
+ return current(arr);
+};
+//# sourceMappingURL=pos.js.map \ No newline at end of file