Matching A Computed Property In Function Args
const get = (key, { [key]: foundValue }) => foundValue;const stuff = { a: 1, b: 2, c: 3 };
console.log("Get a:", get("a", stuff)); // Get a: 1
console.log("Get d:", get("d", stuff)); // Get d: undefinedPreviousMake The Browser Editable With Design ModeNextMatching Multiple Values In A Switch Statement
Last updated