Advertisement
kstoyanov

08. * Calorie Object

Sep 16th, 2020
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function solve(args) {
  2.   const products = {};
  3.  
  4.   args.forEach((el, index) => {
  5.     if (index % 2 === 0) {
  6.       products[el] = Number(args[index + 1]);
  7.     }
  8.   });
  9.  
  10.  
  11.   console.log(products);
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement