3 ms·
Awk is basically what JavaScript syntax is based on (no really!). The following (while not terribly useful) is both awk and JavaScript: function f(x, other
by tannhaeuser 8y ago
Awk is basically what JavaScript syntax is based on (no really!). The following (while not terribly useful) is both awk and JavaScript:
function f(x, otherArgs) {
r = otherArgs["x"]
for (v in otherArgs)
delete otherArgs[v]
return r
}
JavaScript even uses awk-style regexp literals (though with PCRE semantics, and more features, etc.).