JavaScript ES6 - Sample Interview Question (Junior Level)

What will be the output of the following code?

const FOO = {
  num: 1,
  toString: function () {
    return FOO.num++;
  }
}

if(FOO == 1 && FOO == 2 && FOO == 3) {
  console.log('PASS');
}

  1. There will be run-time errors
  2. Empty output
  3. PASS
  4. None of the above
Tests in JavaScript ES6 for Juniors

Test Name Difficulty Time (minutes) No. of Questions
JavaScript ES6 Online Test for Juniors JavaScript ES6 Junior 20 10