Answers for "Use Destructuring Assignment to Assign Variables from Objects"

0

Use Destructuring Assignment to Assign Variables from Objects

var voxel = {x: 7.6, y: 2.6 ,z: 7.83};

var x = voxel.x;
var y = voxel.y;
var z = voxel.z;

const {x: a, y: b, z: c } = voxel;  

const AVG_TEMPERATURES = {
today: 77.8 ,
tomorrow: 79

};

function getTempOftmrw(avgtemperatures){
      "use strict";
      const { tomorrow: tempOfTomorrow } = avgtemperatures;
      
      return tempOfTomorrow;

}

console.log(getTempOftmrw(AVG_TEMPERATURES))
Posted by: Guest on July-06-2021

Code answers related to "Use Destructuring Assignment to Assign Variables from Objects"

Browse Popular Code Answers by Language