Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for [old] Easy Unpack by Sim0000
"use strict";
function easyUnpack(elements) {
return [elements[0], elements[2], elements[elements.length - 2]];
}
var assert = require('assert');
if (!global.is_checking) {
console.log('Examples:')
console.log(easyUnpack([1, 2, 3, 4, 5, 6, 7, 9]))
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 review your tests and earn cool rewards!");
}
April 25, 2019
Comments: