Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
1-liner: dumb idea solution in Clear category for Easy Unpack by --Serial_Sniper--
import assert from "assert";
function easyUnpack(values: any[]): any[] { return [values[0], values[2], values[values.length-2]]; }
console.log('Example:');
console.log(easyUnpack([1, 2, 3, 4, 5, 6, 7, 9]));
// These "asserts" are used for self-checking
assert.deepEqual(easyUnpack([1, 2, 3, 4, 5, 6, 7, 9]), [1, 3, 7]);
assert.deepEqual(easyUnpack([1, 1, 1, 1]), [1, 1, 1]);
assert.deepEqual(easyUnpack([6, 3, 7]), [6, 7, 3]);
console.log("Coding complete? Click 'Check' to earn cool rewards!");
June 6, 2020
Comments: