DEV Community

Kavya S
Kavya S

Posted on

Stepping into JavaScript

What is JavaScript?

JavaScript is a high-level,dynamic and interpreted programming language used to make websites interactive.

we can use it to control anything like data validation, button functionality,animation updates and more.

What is Data type?

Every value in JavaScript has a specific type.

This type determines what operations can be performed on the value and how it is stored.

How many Data types?

There are 8 basic data types in JavaScript

  • String
  • Number
  • Bigint
  • Boolean
  • Undefined
  • Null
  • Symbol
  • Object

JavaScript Variables

In a programming language, variables are used to store data values.

JavaScript uses the keywords var,let and const to declare variables.

When to Use var, let, or const?

  • Only use var if you MUST support old browsers.
  • use let when reassignment is needed
  • Always use const if the value should not be changed

Types of JavaScript Operators

  • Arithmetic Operators
  • Assignment Operators
  • Comparison Operators
  • String Operators
  • Logical Operators
  • Bitwise Operators
  • Ternary Operators
  • Type Operators

Concatenate two strings in JavaScript?

let str1 = "Hello";
let str2 = "World";
let result = str1 + str2;
console.log(result);
Enter fullscreen mode Exit fullscreen mode

Top comments (0)