Search snippets
Browse Code Answers
FAQ
Usage docs
Log In
Sign Up
Home
Javascript
Function to convert an Array to an Associative array
marlene caplan
Programming language:
Javascript
2021-06-26 18:04:29
0
Q:
Function to convert an Array to an Associative array
sycamore
Code:
Javascript
2021-05-11 18:27:23
var obj = {}; for (var i = 0, length = a.length; i < length; i += 2) { obj[a[i]] = a[i+1]; }
0
Tags
array
function
con
Related
associative array in javascript
javascript associative array
javascript init associative array
New to Communities?
Join the community