Can anyone explain for me, what the code below means:
const {Observables} = rxjs
thank you so much!
Can anyone explain for me, what the code below means:
const {Observables} = rxjs
thank you so much!
Lets say we have two objects person1 and person2 and we have function displayPerson. instead of passing using person.age and person.name, we can destructure them using this line.
const { age, name } = person;
Below is an example.
person1 = { age: 30, name : "James" }
person2 = { age: 32, name : "Kelly" }
displayPerson = (person) => {
const { age, name } = person ;
console.log(name + " is " + age.toString() + " years old.")
}
displayPerson(person1)
displayPerson(person2)