[...] Jul 27th, 2007 by kiterminal วันนี้บังเอิญไปเจอ Blog ของ Oliver Steele ซึ่งเค้าไปทำ Functional JavaScript ไว้ ลองมาดูตัวอย่างที่เค้าทำให้ดูละกัน map(function(x){return x+1}, [1,2,3]) -> [2,3,4] filter(function(x){return x>2}, [1,2,3,4]] -> [3,4] some(function(w){return w.length < 3}, ‘are there any short words?’.split(’ ‘)) -> false // double the items in a list: map(’*2′, [1,2,3]) -> [2, 4, 6] // find just the odd numbers: filter(’%2′, [1,2,3,4]) -> [1, 3] // or just the evens: filter(not(’%2′), [1,2,3,4]) -> [2, 4] ทั้งนี้เค้ายังได้ทำ API documentation ไว้ให้อ่านและศึกษากันด้วย [...]

Reply

The content of this field is kept private and will not be shown publicly.
CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
2 + 3 =
Solve this simple math problem and enter the result. E.g. for 1+3, enter 4.