Primitive Values

Riaz Ahmed
3 min readMay 6, 2021

In JavaScript primitive values and primitive data type is not an object or has no method. All primitive values are immutable. Primitive we cannot change because a primitive itself variable assigned a primitive value. We can reassign any value, but the existing value is never change. But object and array can be changed .

var bar = "baz";
console.log(bar);
bar.toUpperCase();
console.log(bar);
Answer: baz,
baz,
undefined

There are seven primitive data-type as there are

  1. string
  2. number
  3. bigint
  4. boolean
  5. undefined
  6. symbol
  7. null

Objects and Functions

Object and function are also value but they are not primitive.if i give any example i think it will be cleared

console.log({});
console.log([]);
console.log(x => x * 2);
answer: {}
[]
x => x * 2

Objects and Expression

you cannot share all your true feelings to your favorite person.In that way javascript has some activities that which is acceptable . Such as example that

console.log(2+6)
answer is: 8

in proposal if it acceptable javascript give right answer.lastly i can said that expression is like a question that javascript can give this answer.The main summary is Expression means string, number, object that JavaScript can able to give this answer.

Types of Values

if people want that they can resaerch about JavaScript. Brandan Eich made JavaScript. but after 25 year they able to success to make nine things .In which anytype of website or any application can build by those nine such types.

What is JavaScript ? How It Work?

JavaScript is a programming language .also it is dynamic language.Basically the JavaScript work Google Chrome V8 engine. For why the JavaScript is too much faster than other programming language.

Try …Catch

Its does not matter how Bigger programmer you are .When you are in coding you must be faced the error.Every get error when he is in coding.

Now come a question in your how handle this error !!! For this you should must type in your code to catch the error —

try {
alert('Start your code');
// ...no errors here
alert('Finish Your Code');}
////error
catch (err) {alert('Catch is ignored, because there are no errors');}

Comments

To be a good developer we need to how to write comment properly ! There are two types of comment. They are —

1:Bad Comment

//here I Show how to declare string
var name='His name is Ashik"
console.log(name)

2: Good Comment

**/
here I Show how to declare Number
*/
var number=999
console.log(number)

JavaScript ES6

ECMAScript is a general-purpose programming language, standardized by Emma International according to the document ECMA-262. It is a JavaScript standard meant to ensure the interoperability of web pages across different web browsers.
React uses ES6, and you should be familiar with some of the new features like:
1.Classes
2.Arrow Functions
3.Variables (let, const, var)

JavaScript ES6 arrow function

ES6 arrow functions provide you with an alternative way to write a shorter way

const names= [
'nafim',
'Nadia',
'Riaz',
'Rahim'
];
console.log(names.map(name => name.length));
answer: [5, 5, 4, 5]

JavaScript ES6 forEach()

ES6 forEach functions provide you with an alternative way to write a shorter way . This is more is useful than plane JavaScript for loop. Its probably most used in react.it's the most shortcut way to declare the Foor loop.

const names=['rahat','ashik','nafim','tafsan']
names.forEach(name => console.log(name));
answer: "rahat" ,"ashik" ,"nafim" ,"tafsan"

--

--

Riaz Ahmed

hey i am riaz . i am junior front-end developper.welcome to my profile...