1
\$\begingroup\$

Some challenges require, for instance, lists as input. A list has a property being its size.

Several languages have builtins to get properties such as the size for a list (all golfing language, JavaScript, Java, C#, to name a few), some don't (C). Those who don't usually pass the list size as argument (but not always).

So is it acceptable for languages who have builtins to still accept an extra parameter which is a property of the input?

For example in JavaScript:

a=>l=>a[l-1]

is shorter than

a=>a[a.length-1]
\$\endgroup\$
1
  • \$\begingroup\$ Yep, it's definitely a duplicate. Sorry I couldn't find it. \$\endgroup\$ Mar 12 '19 at 17:12

Browse other questions tagged .