So I have been reading the awesome SICP book for some time now and the striking thing is the resemblance between JS and Scheme in some areas. Not surprising considering that Scheme was one of the major influences for the JS language. Thus, another reason to learn more languages to become a better programmer.
1. begin and comma operators
Scheme has the begin operator which allows you to evaluate a series of expressions and return the value of the last evaluated expression. This immediately struck me as being related to the JS comma operator which does exactly the same thing!
//JS var x = 1,2,3,4,5; x; //5 //Scheme (define a (begin 1 2 3 4 5)) a; 5
One difference though is the fact that I find begin more useful in Scheme than its JS comma counterpart.
2. Type coercion
Scheme behaves in a similar way too – values are coerced albeit with more rigidity than JS.(if null (display "Null coerced to true!") 3) ; Null coerced to true!
3. Lambdas, first-class functions, closures and maybe lexical Scope
And that’s about it for now.