Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Shortcut for Commenting in Js. #176

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Elaborating the example of equality Operator .
  • Loading branch information
akashshrivas committed Jul 17, 2023
commit 48a77e7d27e44917c6f0fd1386868362748b2a51
4 changes: 4 additions & 0 deletions basics/basic.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
let a = 101;
let b = "101";

console.log(a===b)
7 changes: 7 additions & 0 deletions basics/equality.md
Original file line number Diff line number Diff line change
@@ -11,6 +11,13 @@ var foo = 42;
var bar = 42;
var baz = "42";
var qux = "life";

// Another Example of `===`
var abc = 101;
var def = "101";
// CASE 1 : `==`
```In case 1 output will be true because "==" operator only checks var are equal
Case 2: '===' this operators also check its type(datatype). In our case abc is integer and def is a string so output will be false.```
```

`foo == bar` will evaluate to `true` and `baz == qux` will evaluate to `false`, as one would expect. However, `foo == baz` will _also_ evaluate to `true` despite `foo` and `baz` being different types. Behind the scenes the `==` equality operator attempts to force its operands to the same type before determining their equality. This is in contrast to the `===` equality operator.