From 2efc35d2f9f6a28cb80392ff6f4803596e61ec31 Mon Sep 17 00:00:00 2001 From: Wei Hung Chin Date: Sun, 14 Oct 2018 14:25:12 +0800 Subject: [PATCH] Add code syntax highlighting Add code highlighting for the code examples in the section "Comparing null and undefined" --- .../english/javascript/comparison-operators/index.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/client/src/pages/guide/english/javascript/comparison-operators/index.md b/client/src/pages/guide/english/javascript/comparison-operators/index.md index 07471598a0..405f6c14c0 100644 --- a/client/src/pages/guide/english/javascript/comparison-operators/index.md +++ b/client/src/pages/guide/english/javascript/comparison-operators/index.md @@ -147,13 +147,17 @@ _You can find more information at , <=, >= etc., "null" and "undefined" ar #### Example - compare null with 0(zero) +```javascript console.log( null > 0 ); // O/P - false console.log( null >= 0 ); // O/P - true console.log( null == 0 ); // O/P - false +``` Strange? As per the first statement null is not greater than 0 and from the second statement null is either greater than or equal to 0. So, if we think mathematically and compare both statements, will come to the result that null is equal to 0. But, as per third statement it's not true. Why? @@ -173,9 +179,11 @@ But, in equality check (==), "null/undefined" works without any conversion and a #### Example - compare undefined with 0(zero) +```javascript console.log( undefined > 0 ); // O/P - false console.log( undefined >= 0 ); // O/P - false console.log( undefined == 0 ); // O/P - false +``` Here, we test the same cases as we did for null but again result is different. Why?