teaching machines

From * To Javascript

November 28, 2018 by . Filed under programming languages, public.

Educators must contend with students’ prior knowledge of a subject. Sometimes the prior knowledge is advantageous—but not always. What we “know” may be wrong or incomplete. The same is true with programming languages. When learning a new language, you must contend with the baggage you bring from other languages you know.

Suppose you are C or Java programmer and you see this bit of Javascript code:

function isBetween(lo, hi, x) {
  return
    lo <= x &&
    x <= hi;
}

console.log(isBetween(0, 10, 5));
What output do you expect to see?