SHARE
TWEET

Untitled

a guest Sep 17th, 2019 125 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function createAssociativeArray(array) {
  2.     let result = {};
  3.     for (let i = 0; i < array.length - 1; i++) {
  4.         result[array[i]] = +array[i + 1];
  5.         i++;
  6.     }
  7.     console.log(result);
  8. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top