Over 10 years we helping companies reach their financial and branding goals. Onum is a values-driven SEO agency dedicated.

CONTACTS
ECET 2026 CSE

Day 40 – Evening Session: Web – JavaScript Basics + Syntax – ECET 2026

JavaScript is the backbone of modern web development. For ECET 2026 Web section, questions often focus on syntax, variables, operators, data types, and functions. These are easy scoring areas if you practice them with examples.


📘 Concept Notes

🔑 What is JavaScript?

  • JavaScript (JS) is a scripting language used to make web pages interactive.
  • Runs directly in browsers (client-side).
  • Supports object-oriented, functional, and event-driven programming.

⚙️ Basic Syntax Rules

  1. Case Sensitive:
    • myVar and myvar are different.
  2. Statements End with Semicolon:
let a = 10;
console.log(a);
  1. Comments:
// Single-line comment
/* Multi-line
   comment */

📂 Variables in JavaScript

  • Declared using: var x = 5; // function-scoped let y = 10; // block-scoped const z = 20; // constant

📐 Data Types

  • Primitive: Number, String, Boolean, Undefined, Null, Symbol, BigInt
  • Non-Primitive: Object, Array, Function

🧮 Operators

  • Arithmetic: +, -, *, /, %
  • Assignment: =, +=, -=
  • Comparison: ==, ===, !=, <, >
  • Logical: &&, ||, !

📘 Functions

function add(a, b) {
  return a + b;
}
console.log(add(2, 3)); // Output: 5

Arrow Functions:

const multiply = (x, y) => x * y;<br>

📊 Example Program

let name = "ECET Student";
let marks = 90;

if (marks >= 50) {
  console.log(name + " passed the exam!");
} else {
  console.log(name + " failed.");
}

Output:

ECET Student passed the exam!

🔟 10 Expected MCQs – ECET 2026

Q1. JavaScript is:
A) Compiled language
B) Interpreted scripting language
C) Assembly language
D) Machine language

Q2. Which keyword declares a block-scoped variable?
A) var
B) let
C) const
D) both B & C

Q3. In JavaScript, === operator checks:
A) Only value
B) Only type
C) Value and type
D) None

Q4. Which is a valid comment in JavaScript?
A) # comment
B) // comment
C) <!-- comment -->
D) ** comment **

Q5. What is the output of console.log(2 + "2")?
A) 4
B) 22
C) Error
D) Undefined

Q6. Which function syntax is correct?
A) def add(x,y)
B) function add(x,y)
C) func add(x,y)
D) fn add(x,y)

Q7. Which data type is NOT primitive?
A) Number
B) Array
C) String
D) Boolean

Q8. What does const mean?
A) Variable can’t change
B) Variable can change
C) Function declaration
D) Scope keyword

Q9. Which operator is logical AND in JavaScript?
A) &
B) &&
C) and
D) ||

Q10. Which statement is true?
A) JS runs only on server
B) JS runs only on browser
C) JS runs both in browser and server
D) JS is not portable


✅ Answer Key

Q.NoAnswer
Q1B
Q2D
Q3C
Q4B
Q5B
Q6B
Q7B
Q8A
Q9B
Q10C

🧠 Explanations

  • Q1 → B: JS is an interpreted scripting language.
  • Q2 → D: Both let and const are block-scoped.
  • Q3 → C: === checks both type and value.
  • Q4 → B: // comment is valid.
  • Q5 → B: Number + string → concatenation → "22".
  • Q6 → B: Functions use function keyword.
  • Q7 → B: Arrays are objects (non-primitive).
  • Q8 → A: const means the reference cannot change.
  • Q9 → B: Logical AND = &&.
  • Q10 → C: JS can run in browsers and servers (Node.js).

🎯 Why Practice Matters

  • JS basics form the foundation of DOM, events, AJAX, and frameworks (React, Angular).
  • ECET questions are mostly direct and concept-based.
  • Mastering syntax = quick scoring.

📲 Join Our ECET Prep Community on WhatsApp

👉 Join WhatsApp Group – Click Here

Leave a comment

Your email address will not be published. Required fields are marked *