0% found this document useful (0 votes)
13 views2 pages

Javascript Syllabus

The JavaScript syllabus for Unit II covers fundamental concepts including introduction to JavaScript, decision-making structures, operators, control statements, and functions. It includes examples for each topic such as loops, programmer-defined functions, and recursion. The unit concludes with encouragement for exam preparation.

Uploaded by

lpu.online.bca
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views2 pages

Javascript Syllabus

The JavaScript syllabus for Unit II covers fundamental concepts including introduction to JavaScript, decision-making structures, operators, control statements, and functions. It includes examples for each topic such as loops, programmer-defined functions, and recursion. The unit concludes with encouragement for exam preparation.

Uploaded by

lpu.online.bca
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

JavaScript Syllabus - Unit II

1. Introduction to JavaScript & Simple Program


- JavaScript is a versatile scripting language for web development.
- Example: Hello World
<script>
console.log('Hello, World!');
</script>

2. Decision Making
- if statement
if (condition) { /* code */ }
- if-else statement
if (cond) { /* true */ } else { /* false */ }
- nested if

3. Equality & Relational Operators


- == vs === (type coercion vs strict)
- != vs !==
- >, <, >=, <=
- Examples:
5 == '5' // true
5 === '5' // false

4. Control Statements
- for loop: for (let i = 0; i < n; i++) { }
- while loop: while (condition) { }
- do-while loop: do { } while (condition);
- switch-case:
switch(value) {
case 1: /* ... */ break;
default: /* ... */
}

5. Functions
- Declaration: function name(params) { }
- Expression: const f = function(params) { };
- Arrow: const f = (params) => { };

6. Programmer-Defined Functions
- Example: Sum of two numbers
function sum(a, b) {
return a + b;
}
console.log(sum(5, 3)); // 8

7. JavaScript Global Functions


- alert(), prompt(), confirm()
- parseInt(), parseFloat(), isNaN()
- encodeURI(), decodeURI()
8. Recursion
- Function calling itself
- Example: Factorial
function factorial(n) {
if (n <= 1) return 1;
return n * factorial(n - 1);
}
console.log(factorial(5)); // 120

Good luck on your exam!

You might also like