DEV Community

Madhavan G
Madhavan G

Posted on

JavaScript

WHAT IS JAVASCRIPT?

⇒JavaScript is a high-level programming language mainly used to make websites interactive and dynamic.
⇒It also known as scripting Language.

What JavaScript Does?

⇒It runs in your browser (like Chrome, Edge, etc.) and lets you:
- Update content on a page without reloading
- Handle user actions (clicks, typing)
- Create animations and effects
- Communicate with servers (APIs)

Where JavaScript Is Used?

  • Frontend (browser)
  • Buttons, forms, animations
  • Backend (server-side) using tools like Node.js
  • Mobile apps (React Native)
  • Games & desktop apps

Datatypes Javascript:

⇒In JavaScript, data types define what kind of value a variable can hold.

They are mainly divided into two categories:

     I.Primitive Data Types
     II.Non-Primitive Data Types
Enter fullscreen mode Exit fullscreen mode

Primitive Data Types:

1.Numbers
2.String
3.Boolean
4.Undefined
5.Null
6.BigInt
7.Symbol

Non-Primitive Data Types:
1.Object
2.Array
3.Function

Now What is Primitive and Non-Primitive?
Let see:

Primitive:These are basic,they store the actual value directly and we can't change the value that is immutable values.
Non-Primitive:These are complex objects that store collections of data and we can change the value that is Mutable values.

What are the keywords in JavaScript?
•In JavaScript, keywords are reserved words that have a special meaning and cannot be used as variable names, function names, or identifiers.

Common JavaScript Keywords:

  1. Variable Declaration:

    • var
    • let
    • const

2.Control Flow (Conditions & Loops):
• if, else, switch, case, default
• for, while, do, break, continue

3.Functions & Return:
• function
• return

4.Object & Class Related:
• class, constructor
• this
• new

5.Error Handling:
• try, catch, finally, throw

6.Modules (Modern JavaScript)
• import, export

7.Other Important Keywords:
• typeof
• instanceof
• delete
• in
• void
• yield
• await
• async

Top comments (0)