Can i use variable names that do not match the keyword in the object. The only way I can make this work is to use make
variable name same as the keyword from the object. I would of thought I could use any variable name.
variable name same as the keyword from the object. I would of thought I could use any variable name.
Code:
const person ={
firstName: "SpongeBob",
lastName: "Square",
age: 30,
job: "Fry Cook",
}
const {fName, lName, ag} = person
console.log(fName); //undefined
