add-values-to-primitive.js 363 B

123456789101112
  1. load("test-common.js");
  2. try {
  3. // Note that these will give different results in the REPL due to parsing behavior.
  4. assert([] + [] === "");
  5. assert([] + {} === "[object Object]");
  6. assert({} + {} === "[object Object][object Object]");
  7. assert({} + [] === "[object Object]");
  8. console.log("PASS");
  9. } catch (e) {
  10. console.log("FAIL: " + e);
  11. }