To rephrase this question in better detail, why do we need to do Js.Array2.length(arr)
as opposed to arr.length
?
This question also applies to any other properties of objects such as strings where we do not have access to instance methods (like str.slice()
).
Is this a pattern that’s part of functional programming as a whole and are there any performance benefits of grabbing values in this way?