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

Unit 3 JavaScript Cheat Sheet

This document is a cheat sheet for JavaScript, covering definitions, basics, and syntax. It includes key concepts such as functions, arrays, the DOM, built-in objects, and jQuery, along with their respective syntax. Additionally, it addresses topics like form validation, regular expressions, and JSON.

Uploaded by

guest guest
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)
10 views2 pages

Unit 3 JavaScript Cheat Sheet

This document is a cheat sheet for JavaScript, covering definitions, basics, and syntax. It includes key concepts such as functions, arrays, the DOM, built-in objects, and jQuery, along with their respective syntax. Additionally, it addresses topics like form validation, regular expressions, and JSON.

Uploaded by

guest guest
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

UNIT–3 : JavaScript Cheat Sheet (Definitions,

Basics & Syntax)


1. JavaScript
JavaScript is a client-side scripting language used to create dynamic and interactive web pages.

2. Function
A function is a block of code designed to perform a specific task.
Syntax:
function functionName() { statements; }

3. Switch Statement
Used to execute different blocks of code based on a condition.
Syntax:
switch(expression) { case value: statements; break; }

4. Prompt Box
Used to take input from the user.
Syntax: prompt("message");

5. Array
An array is used to store multiple values in a single variable.
Syntax:
var a = [1,2,3];

6. Array Methods
push() → add element
pop() → remove element
length → size of array

7. Fibonacci Series
A series where each number is sum of previous two numbers.

8. DOM
Document Object Model represents HTML as tree structure and allows dynamic manipulation.
Syntax:
[Link]("id");

9. Built-in Objects
String, Math, Date, Array, Number

10. String Methods


length, toUpperCase(), toLowerCase(), charAt(), replace()

11. Regular Expression


A pattern used for string matching and validation.
Syntax:
/^[0-9]{10}$/

12. Form Validation


Checking user input before submission using JavaScript.

13. JSON
JavaScript Object Notation used for storing and transferring data.
Syntax:
{ "key":"value" }

14. jQuery
A JavaScript library used to simplify DOM manipulation.
Syntax:
$(selector).action();

15. jQuery Selectors


$("p") → element
$("#id") → id
$(".class") → class

16. Event
An action performed by user like click, submit, load.

You might also like