JS rawat
Chapter 2 Variables and Datatypes:
Chapter:3 Operators & Conditions
Chapter:4 Arrays
Q35: What are Arrays in JS? How to get, add & remove elements from arrays?
anwers
Q36: What is the indexOf() method of an Array?
anwers
Q37: What is the difference between find() and filter() methods of an Array?
anwers
Q38: What is the slice() method of an Array?
anwers
Q39: What is the difference between push() and concat() methods of an Array?
anwers
Q40: What is the difference between pop() and shift() methods of an Array?
anwers
Q41: What is the splice() method of an Array?
anwers
Q42: What is the difference between the slice() and splice() methods of an Array?
anwers
Q43: What is the difference map() and forEach() array methods of an Array?
anwers
Q44: How to sort and reverse an array?
anwers
Q45: What is Array Destructuring in JS?
anwers
Q46: What are array-like objects In JS?
anwers
Q47: How to convert an array-like object into an array?
anwers
Chapter 5: Loops
Q. What is a loop? What are the types of loops in JS?
anwers
Q. What is the difference between while and for loops?
anwers
Q. What is the difference between while and do-while loops?
anwers
Q. What is the difference between break and continue statement?
anwers
Q. What is the difference between for and for...of loop in JS?
anwers
Q. What is the difference between for...of and for...in loop?
anwers
Q. What is forEach method? Compare it with for...of and for...in loop?
anwers
Q. When to use for...of loop and when to use forEach method in applications?
anwers
Chapter 6: Functions
anwers
Q. What are Functions in JS? What are the types of function?
anwers
Q. What is the difference between named and anonymous functions? When to use what in applications?
anwers
Q. What is function expression in JS?
anwers
Q. What are Arrow Functions in JS? What is it use?
anwers
Q. What are Callback Functions? What is it use?
anwers
Q. What is Higher-order function In JS?
anwers
Q. What is the difference between arguments and parameters?
anwers
Q. In how many ways can you pass arguments to a function?
anwers
Chapter 7: Strings
anwers
Q. What is a String?
anwers
Q. What are template literals and string interpolation in strings?
anwers
Q. What is the difference between single quotes ("), double quotes ("") & backticks (")?
anwers
Q. What are some important string operations in JS?
anwers
Q. What is string immutability?
anwers
Q. In how many ways you can concatenate strings?
anwers
Chapter 8: DOM
anwers
Q. What is DOM? What is the difference between HTML and DOM?
anwers
Q. How do you select, modify, create and remove DOM elements?
anwers
Q. What are selectors in JS?
anwers
Q. What is the difference between getElementByld, getElementsByClassName and getElementsByTagName?
anwers
Q. What is the difference between querySelector() and querySelectorAll()?
anwers
Q. What are the methods to modify elements properties and attributes?
anwers
Q. What is the difference between innerHTML and textContent?
anwers
Q. How to add and remove properties of HTML elements in the DOM using JS?
anwers
Q. How to add and remove style from HTML elements in DOM using JS?
anwers
Q. How to create new elements in DOM using JS? What is the difference between createElement() and cloneNode()?
anwers
Q. What is the difference between createElement() and create TextNode()?
anwers
Chapter 9: Error Handling
anwers
Q. What is Error Handling in JS?
anwers
Q. What is the role of finally block in JS?
anwers
Q. What is the purpose of the throw statement in JS?
anwers
Q. What is Error propagation in JS?
anwers
Q. What are the best practices for error handling?
anwers
Q. What are the different types of errors In JS?
anwers
Chapter 10: Objects
anwers
Q. What are Objects in JS?
anwers
Q. In how many ways we can create an object?
anwers
Q. What is the difference between an array and an object?
anwers
Q. What is the difference between array and objects?
anwers
Q. How do you add or modify or delete properties of an object?
anwers
Q. Explain the difference between dot notation and bracket notation?
anwers
Q. What are some common methods to iterate over the properties of an object?
anwers
Q. How do you check if a property exists in an object?
anwers
Q. How do you clone or copy an object?
anwers
Q. What is the difference between deep copy and shallow copy in JS?
anwers
Q. What is Set Object in JS?
anwers
Q. What is Map Object in JS?
anwers
Q. What is the difference between Map and Object in JS?
anwers
Chapter 11: Events
anwers
Q. What are Events? How are events triggered?
anwers
Q. What are the types of events in JS?
anwers
Q. What is Event Object in JS?
anwers
Q. What is Event Delegation in JS?
anwers
Q. What is Event Bubbling In JS?
anwers
Q. How can you stop event propagation or event bubbling in JS?
anwers
Q. What is Event Capturing in JS?
anwers
Q. What is the purpose of the event.preventDefault() method in JS?
anwers
Q. What is the use of "this" keyword in the context of event handling in JS?
anwers
Q. How to remove an event handler from an element in JS?
anwers
Chapter 12: Closures
anwers
Q. Explain the concept of Lexical Scoping?
anwers
Q. What is Closure?
anwers
Q. What are the benefits of Closures?
anwers
Q. What is the concept of Encapsulation in the context of closures?
anwers
Q. What are the disadvantage or limitations of Closures?
anwers
Q. How can you release the variable references or closures from memory?
anwers
Q. What is the difference between a Regular Function and a Closure?
anwers
Chapter 13: Asynchronous programming - Basics
anwers
Q. What is asynchronous programming in JS? What is its use?
anwers
Q. What is the difference between synchronous and asynchronous programming?
anwers
Q. What are the techniques for achieving asynchronous operations in JS?
anwers
Q. What is setTimeout()? How is it used to handle asynchronous operations?
anwers
Q. What is setInterval()? How is it used to handle asynchronous operations?
anwers
Q. What is the role of callbacks in fetching API data asynchronously?
anwers
Q. What is callback hell? How can it be avoided?
anwers
Chapter 14: Asynchronous programming - Promises
anwers
Q. What are Promises in JavaScript?
anwers
Q. How to implement Promises in JavaScript?
anwers
Q. When to use Promises in real applications?
anwers
Q. What is the use of Promise.all() method?
anwers
Q. What is the use of Promise.race() method?
anwers
Q. What is the difference between Promise.all() and Promise.race()?
anwers
Chapter 15: Asynchronous Programming - Async Await JS
-
anwers
Q. What is the purpose of async/ await? Compare it with Promises?
anwers
Q. Explain the use of async and await keywords in JS?
anwers
Q. Can we use async keyword without await keyword and vice versa?
anwers
Q. How do you handle errors in async/ await functions?
anwers
Chapter 16: Browser APIs & Web Storage
anwers
Q. What is a window object?
anwers
Q. What are Browser APIs in JS?
anwers
Q. What is Web Storage, and its use? How many types of web storage are there?
anwers
Q. What is Local Storage? How to store, retrieve and remove data from it?
anwers
Q. What is Session Storage? How to store, retrieve and remove data from it?
anwers
Q. What is the difference between LocalStorage and SessionStorage?
anwers
Q. How much data can be stored in localStorage and sessionStorage?
anwers
Q. What are cookies? How do you create and read cookies?
anwers
Q. What is the difference between cookies and web storage?
anwers
Q. When to use cookies and when to use web storage?
anwers
Chapter 17: Classes, Constructors, this & Inheritance
anwers
Q. What are Classes in JS?
anwers
Q. What is a constructor?
anwers
Q. What are constructor functions?
anwers
Q. What is the use of this keyword?
anwers
Q. Explain the concept of prototypal inheritance?
anwers
Chapter 18: ECMAScript & Modules
anwers
Q. What is ES6? What are some new features introduced by it?
anwers
Q. What are Modules in JS?
anwers
Q. What is the role of export keyword?
anwers
Q. What are the advantages of modules?
anwers
Q. What is the difference between named exports and default exports?
anwers
Q. What is the difference between static and dynamic imports?
anwers
Q. What are module bundlers?
anwers
Chapter 19: Security & Performance
anwers
Q. What is eval() function in JS?
anwers
Q. What is XSS (Cross-Site Scripting) attack?
anwers
Q. What is SQL Injection attack?
anwers
Q. What are some best practices for security in JS?
anwers
Q. What are the best practices for improving performance in JS?
anwers
Chapter 20: Scenario based - Tricky Short Questions
anwers
Q. How to execute a piece of code repeatedly after some fix time?
anwers
Q. How to handle asynchronous operations In JS?
anwers
Q. How to manipulate and modify CSS styles of HTML elements dynamically?
anwers
Q. How to handle errors and exceptions in your code?
anwers
Q. How to store key-value pairs & efficiently access and manipulate the data?
anwers
Q. How to iterate over elements in an array and perform a specific operation on each element?
anwers
Q. How to dynamically add or remove elements from a web page?
anwers
Q. What method is used to retrieve data from an external API?
anwers
Q. How to manage the state in a web application?
anwers
Q. How to implement a queue or a stack like data structure in JS?
anwers
—
Chapter 20: Scenario based – Tricky Short Questions
anwers
Q. How do you attach an event handler to an HTML element?
anwers
Q. How to perform actions based on keyboard events in JS?
anwers
Q. How to fetch data from multiple APIs in parallel and process the results together?
anwers
Q. What are the methods to manipulate JSON data efficiently?
anwers
Q. How to get the current URL of a webpage?
anwers
Q. How do you find the length of an array in JS?
anwers
Q. How to create a copy of an array?
anwers
Q. How do you access individual characters in a string?
anwers
Q. How can you check if a string contains a specific substring?
anwers
Q. Can you modify the value of a variable captured in a Closure?
anwers
Chapter 21: Scenario based - Feature Development
anwers
Q. How to validate user input as they type in a form?
anwers
Q. How to implement pagination for displaying large sets of data?
anwers
Q. How to implement drag-and-drop functionality for elements on a web page?
anwers
Q. How to implement a feature that allows users to search for specific items in a large dataset?
anwers
Q. How to implement a feature that allows users to perform live search suggestions as they type?
anwers
Q. How to implement a real-time chat application using JS.
anwers
Q. How to create an infinite scrolling feature using JS when a user reaches the bottom of a webpage?
anwers
Q. How to implement a toggle switch that changes the theme (light/dark mode) of a website when clicked.
anwers
Q. How to use JS to dynamically update date in real time on webpage?
anwers
Q. How to prevent a form from being submitted without required fields being filled?
anwers
Chapter 12: Coding
anwers
Q. Write a function that returns the reverse of a string?
anwers
Q. Write a function that returns the longest word in the sentence.
anwers
Q. Write a function that checks whether a given string is a palindrome or not?
anwers
Q. Write a function to remove duplicate elements from an array.
anwers
Q. Write a function that checks whether two strings are anagrams or not?
anwers
Q. Write a function that returns the number of vowels in a string.
anwers
Q. Write a function to find the largest number in an array.
anwers
Q. Write a function to check if a given number is prime or not?
anwers
Q. Write a function to calculate the factorial of a number.
anwers
Q. Write a program to remove all whitespace characters from a string.
anwers
Q. Write a function to find the sum of all elements in an array
anwers
Chapter 12: Coding
anwers
Q. Write a function to find the average of an array of numbers.
anwers
Q. Write a function to sort an array of numbers in ascending order.
anwers
Q. Write a function to check if a given array is sorted in ascending order or not.
anwers
Q. Write a function to merge two arrays into a single sorted array.
anwers
Q. Write a function to remove a specific element from an array.
anwers
Q. Write a function to find the second largest element in an array.
anwers
Q. Write a function to reverse the order of words in a given sentence.
anwers
Q. Write a function to find the longest common prefix among an array of strings.
anwers
Q. Write a function to find the intersection of two arrays.
anwers
Q. Write a function to calculate the Fibonacci sequence up to a given number.
anwers
Comments
Post a Comment