0% found this document useful (0 votes)
2 views2 pages

JavaScript Oper-WPS Office

Uploaded by

ylaaouina357
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views2 pages

JavaScript Oper-WPS Office

Uploaded by

ylaaouina357
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

// =======================

// JavaScript Operators Test + Answers

// =======================

// ===== Part 1 — ‫===== حسابات‬

[Link]("1:", 6 + 2 * 3); // 12

[Link]("2:", (6 + 2) * 3); // 24

[Link]("3:", 15 / 3 + 2); // 7

[Link]("4:", 15 / (3 + 2)); // 3

[Link]("5:", 7 % 4); // 3

// ===== Part 2 — Strings & Numbers =====

[Link]("6:", "10" + 5); // "105"

[Link]("7:", "10" - 5); // 5

[Link]("8:", "10" * 2); // 20

[Link]("9:", "10" == 10); // true

[Link]("10:", "10" === 10); // false

// ===== Part 3 — Logique =====

[Link]("11:", true && false); // false

[Link]("12:", true || false); // true

[Link]("13:", !false); // true

[Link]("14:", 5 > 3 && 2 > 1); // true

[Link]("15:", 5 > 3 && 2 < 1); // false


// ===== Part 4 — Increment / Decrement =====

let a = 3;

[Link]("16:", a++); // 3 (post-increment)

[Link]("17:", a); // 4

let b = 3;

[Link]("18:", ++b); // 4 (pre-increment)

// ===== Part 5 — Tricky JS =====

[Link]("19:", null == undefined); // true

[Link]("20:", null === undefined); // false

[Link]("21:", 0 == false); // true

[Link]("22:", 0 === false); // false

[Link]("23:", "" == 0); // true

[Link]("24:", "" === 0); // false

[Link]("25:", Boolean("0")); // true

// =======================

// End of Test

// =======================

You might also like