DEV Community

front_end_shifu_2022
front_end_shifu_2022

Posted on

1 1

Js fundementals

Tips:
primitive data type:
assigning to primitive data type any changes are made directly to that value.
non-primitive data-type:
assigning non-primitive value to variable is done by reference ,so any changes will affect all the references.

Difference between undefined and null:
both represent no value
undefined : javascript cant find value for this.
null: Programmer set the values.

let number1 = undefined-20; //undefined to NAN
console.log(number1);//NaN

let number2 = 20 + null; ///null to 0
console.log(number2);//20

strings:
There are three types of strings
1) double quotes:"Hello"
2) single quotes:'Hello'
3) backticks:`Hello'

double quotes and single quotes are simple quotes.There's practically no difference between them in javascript.
example:
console.log('my name is "john".');
console.log("my name is 'john'.");

backticks are "extended functionality quotes. They allow us to include variable and expression into string by wrapping it in ${...}.
for example;
let name="scolfield";
console.log(your name is ${name})

Thanks for reading.

Speedy emails, satisfied customers

Postmark Image

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay