What is the definition of ‘Idiomatic’ as in Idiomatic Javascript?

Idiomatic here means “How people who write JavaScript write JavaScript”.

It means “Natural to the native speaker”.

For example, returning an object is considered by some idiomatic JavaScript:

function foo(){
    return {x:3,y:5};
}
var point = foo();

While “out parameters” are considered less idiomatic:

function foo(out){
    out.point = {x:3,y:5}
}
var out = {};
foo(out);
point = out.point;

Another example of idiomatic JavaScript is the use of closures.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)