Реструктурирование
- процесс воссоединения переменных из глобальной области видимости в объект.
let name = "Mercury", rotationPeriod = 58.6462
let print = function(){
console.log(`Planet: ${this.name} Rotation period: ${this.rotationPeriod}`)
}
let planet = {name, print, rotationPeriod}
planet.print()//Planet: Mercury Rotation period: 58.6462