Advertisement
dabidabidesh

Calorie Object

Sep 17th, 2020
2,544
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //08. * Calorie Object
  2. calorieObject = arr => {
  3.   'use-strict'
  4.  
  5.   let foodCal = {}
  6.  
  7.   for (let i = 0; i < arr.length; i += 2) {
  8.     foodCal[arr[i]] = +arr[i + 1]
  9.   }
  10.  
  11.   console.log(foodCal)
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement