Programming language comparison
From WhyNotWiki
| [Ruby (category)] | [JavaScript (category)] | [PHP (category)] | [Python (category)] | [Smalltalk (category)] | [Java (category)] | |
|---|---|---|---|---|---|---|
| Array.new(...) | new Array(...) | |||||
self |
this |
$this |
||||
to_s |
toString() |
|||||
| Iterators | ||||||
map |
map() (>=1.6) |
|||||
| select | filter() | |||||
| each | forEach | |||||
| any? | some | |||||
| every? | all | |||||
| Strings | ||||||
| string.split | string.split() | |||||
| array.join(separator) | array.join(separator) | |||||
| string.downcase | string.toLowerCase() | |||||
| ... | ||||||
function(x) x * x (>=1.8) |
lambda x: x * x |
x * x ] | ||||
nodes.inject([], function(total, node) total.concat(node.childNodes)); (Prototype) or reduce (JS >=1.8) |
reduce |
|||||
Categories: Ruby | JavaScript | PHP | Python | Smalltalk | Java | Programming languages | Programming
