jeudi 18 août 2016

why cannot javascript execute methods inside methods?

In functional languages functions can execute inside the argument brackets of nested functions what is the equivalent for javascript which is meant to be inspired by Scheme.

f( f ( f ( f)))

console.log( 1 + 1 )
//2

how come javascript can execute addition inside the .log method argument parentheses?

var list1 = []
console.log(list1.push("a"))
//1

yet it cannot execute the push method inside the .log method parentheses? and why does it return 1?

Aucun commentaire:

Enregistrer un commentaire