Yes, and it's also called fold
in many other programming languages and in Mathematics. Ruby aliases a lot in order to be intuitive to programmers with different backgrounds. If you want to use #length
on an Array
, you can. If you want to use #size
, that's fine too!
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…