Groovy是否具有像Javascript那样的对象分解功能?
Groovy是否使用多个赋值(如Javascript)进行对象分解:Groovy是否具有像Javascript那样的对象分解功能?,groovy,destructuring,Groovy,Destructuring,Groovy是否使用多个赋值(如Javascript)进行对象分解: let options = { title: "Menu", width: 100, height: 200 }; let {title, width, height} = options; alert(title); // Menu alert(width); // 100 alert(height); // 200 Groovy没有JavaScript的对象解构。。。它只有基于索引的分解结构
let options = {
title: "Menu",
width: 100,
height: 200
};
let {title, width, height} = options;
alert(title); // Menu
alert(width); // 100
alert(height); // 200
Groovy没有JavaScript的对象解构。。。它只有基于索引的分解结构