Destruct

Run Settings
LanguageJavaScript
Language Version
Run Command
const [ head, ...tail ] = [ 1, 2, 3, 4, 5 ]; // const head = ([ head, ...tail ]) => head; // const tail = ([ head, ...tail ]) => tail; // console.log( head([1,2,3]) ); // console.log( tail([1,2,3]) ); console.log(tail);
const formItem = (name, param, funcArray) => { // const item = param.toString(); const item = name.split("").reverse().join("")[0] name[0] == 'm' ? funcArray[0](item) : funcArray[1](item); }; function monthDecorator(item){ console.log('Месяц '+item); } function kvDecorator(item){ console.log('Квартал '+item); } const m1 = '0.15'; formItem('k1', m1, [monthDecorator, kvDecorator]);
Editor Settings
Theme
Key bindings
Full width
Lines