0% found this document useful (0 votes)
107 views

10 question javascript

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)
107 views

10 question javascript

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

10 JavaScript Theory Questions for BCA 2nd Semester

1. What is JavaScript?
● JavaScript is a versatile scripting language primarily used for creating interactive web
pages. It runs on the client-side, allowing for dynamic content, user interactions, and web
application development.
2. What are the different data types in JavaScript?
● JavaScript supports various data types:
○ Primitive Data Types:
■ Number
■ String
■ Boolean
■ Undefined
■ Null
■ Symbol (ES6)
○ Complex Data Type:
■ Object
3. Explain the concept of variables and how to declare them in JavaScript.
● Variables are containers used to store data values. They are declared using the var, let, or
const keywords.
○ var: Function-scoped or globally scoped.
○ let: Block-scoped.
○ const: Block-scoped and cannot be reassigned.
4. What are operators in JavaScript?
● Operators are symbols used to perform operations on variables and values. JavaScript
supports various operators:
○ Arithmetic operators (+, -, *, /, %, ++, --)
○ Assignment operators (=, +=, -=, *=, /=, %=)
○ Comparison operators (==, ===, !=, !==, >, <, >=, <=)
○ Logical operators (&&, ||, !)
5. What is a function in JavaScript?
● A function is a block of code designed to perform a specific task. It can be reused multiple
times throughout the code. Functions are defined using the function keyword.
6. Explain the concept of DOM manipulation in JavaScript.
● DOM (Document Object Model) represents the structure of an HTML document as a
tree-like structure. JavaScript can manipulate the DOM to dynamically change the
content, style, and structure of the page.
7. What is an event in JavaScript?
● An event is an action or occurrence that happens in a web page, such as clicking a
button, hovering over an element, or submitting a form. JavaScript can respond to these
events and execute specific code.
8. What is the difference between == and === operators?
● == (loose equality): Compares values after type coercion.
● === (strict equality): Compares both value and type.
9. What is the purpose of the this keyword in JavaScript?
● The this keyword refers to the object that the current function is a method of. Its value
depends on how the function is called.
10. What is asynchronous JavaScript?
● Asynchronous JavaScript allows code to execute without blocking the main thread. It's
often used for tasks like fetching data from a server or handling timeouts. Techniques like
callbacks, promises, and async/await are used to handle asynchronous operations.
● https://github.com/Hakolostar/JavaScript
● https://github.com/sajalsa86/js-basic

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy