Enhanced Object Properties

Run Settings
LanguageJavaScript
Language Version
Run Command
console.log("Hello World!"); // //calculator is a object const pricePropName='PRICE'; const calculator=(name,price) =>{ return { // name:name name, // add: function(n1,n2) add(n1,n2){ return n1+n2+name; }, [pricePropName.toLowerCase()]: price //[] will create a member in a object with name price (lower case) } } const calc=calculator('casio',19.99); console.log(calc.name); console.log(calc.add(23,32)); console.log(calc.price);
Editor Settings
Theme
Key bindings
Full width
Lines