# Requiring an objectly array in JavaScript

Consider an example challenge:

Given a number b and an array a, output the bth element of the array a.

In this case, when requiring input in JavaScript, we need an array and a number as input.

The usual (accepted) function input method are (a,b)=>a[b] or a=>b=>a[b], but can I require to input the array a with extra property b, which is constructed by

a=[1,2,3]; a.b=2;


and the submission is a=>a[a.b] ?

If that's allowed, does it increase the byte-count?

However, passing a dictionary-like object ({a: [1, 2, 3], b: 2}) is valid.
• Is f({a:[1,2,3],b:2}) explicitly allowed? Is f({'for(i in x)if(i!="b")c=i;x[c][x.b]':[1,2,3],b:2}) explicitly banned as a loophole? – l4m2 Dec 31 '17 at 6:13