Um programador Argentino chamado Nicolas Garcia inspirado pelo SmallTalk criou uma bela biblioteca Javascript com funções extremamente interessantes chamada SScript (S de Squeak e SmallTalk).
Alguns exemplos:
[1, 2, 3, 4]._select(':x | ^x > 2');
[1, 2, 3, 4, 1]._includesAnyOf([7, 8, 9]);
[1, 2, 3]._sort(':x :y | ^x > y');
E outro carinha criou uma biblioteca para escrever javascript funcional (map, reduce, filter), chamada “Functional Javascript”
Exemplos:
map('x+1', [1,2,3])
select('x>2', [1,2,3,4])
some('_.length < 3', 'are there any short words?'.split(' '))
Então javascript vira uma linguagem com vários paradigmas!

0 responses so far ↓
There are no comments yet...Kick things off by filling out the form below.
Leave a Comment