-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathQues 1.js
26 lines (18 loc) · 1.16 KB
/
Ques 1.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// 1- Role of Operators in JavaScript
// Operators in JavaScript are symbols or keywords used to perform operations on operands.
// They are the building blocks of expressions and enable developers to execute
// computations, make decisions, and manipulate data effectively.
//2-Why Are Operators Essential in Programming?
// Foundation of Expressions:
// Operators form the basis of most expressions, enabling calculations, comparisons, and decisions.
// Simplify Code:
// Operators allow compact expressions that are easy to read and write. For example:
// let result = (x > 10) ? "Greater" : "Smaller";
// Enable Decision-Making:
// Conditional and logical operators play a vital role in control structures like if-else, while, and for.
// Data Manipulation:
// Operators provide tools to manipulate and transform data effectively, e.g., using arithmetic, bitwise, or string operators.
// Improve Efficiency:
// Using operators like assignment shorthand (+=, *=) reduces repetitive code and enhances performance.
// Support Dynamic Programming:
// JavaScript’s dynamic nature relies heavily on operators to determine types, compare values, and handle diverse data structures.