1.
Different ways of executing JavaScript in Browser
JavaScript can be executed in the browser in multiple ways depending upon usage and
requirement: 1) Inline JavaScript: Code is written inside HTML tags using attributes. 2) Internal
JavaScript: Code is written inside script tag within HTML file. 3) External JavaScript: Code is written
in a separate JS file and linked using src. 4) Browser Console: Used for testing and debugging. 5)
Event-Based Execution: Executes in response to events.
2. Unary and Bitwise Operators in JavaScript
Unary operators work on a single operand such as increment, decrement, typeof, and logical NOT.
Bitwise operators perform operations on binary representations like AND, OR, XOR, shift operators.
3. Iterative and Reduction Methods of an Array
Iterative methods traverse array elements one by one. Examples include forEach, map, filter.
Reduction method reduce combines array elements into a single value.
4. Difference between var and let
var is function scoped and allows redeclaration. let is block scoped and does not allow redeclaration
within the same scope.
5. Conditional and Assignment Operators
Conditional operator selects value based on condition. Assignment operators assign values such as
equals, plus equals, minus equals.
6. Typed Arrays Usage and Creation
Typed Arrays handle raw binary data efficiently. They are used in graphics, audio processing, and
networking.
7. JavaScript Data Types
Primitive data types include Number, String, Boolean, Undefined, Null, Symbol, BigInt.
Non-primitive data types include Object, Array, and Function.
8. Scope of Variables in JavaScript
Scope defines variable accessibility. JavaScript supports global, function, and block scope.
9. Difference between Object and Map
Objects store key value pairs with string keys. Maps allow keys of any data type and maintain
insertion order.
10. Methods and Properties of an Object
Properties store values and methods are functions inside objects. Common methods include Object
keys, values, and entries.
11. Iterating Object using for-in and for-of
for-in loop iterates over keys of an object. for-of loop iterates over iterable values.
12. RegExp Instance Properties
RegExp object contains properties like global, ignoreCase, multiline, and source.
13. Iterator and Generator
Iterator uses next method to iterate. Generator uses function star and yield keyword.
14. Data and Accessor Properties
Data properties store actual values. Accessor properties define getter and setter methods.
15. Prototype and its Working
Prototype enables inheritance in JavaScript. Objects inherit properties via prototype chain.
Object -> Prototype -> Prototype -> null
16. Inheritance using JavaScript Class
Inheritance allows classes to reuse code using extends keyword.
17. Reading Properties of an Object
Properties can be accessed using dot or bracket notation. Functions like Object keys and
hasOwnProperty are used.
18. Property Hierarchy of Prototype
Property lookup follows object to prototype to null.
childObject -> ParentPrototype -> ObjectPrototype -> null
19. Proxy Object for Voting Eligibility
Proxy intercepts object access and validates age before voting.
20. Object Creation Patterns
Factory pattern returns objects. Constructor pattern uses new keyword. Prototype pattern shares
methods.
21. Prototype Chaining Inheritance
Child prototype is linked to parent prototype for inheritance.
22. [Link] API
[Link] checks if property exists in an object.
23. Execution Flow of Function Constructor
Object creation, prototype linking, property assignment, and return occurs.
new -> create object -> link prototype -> assign properties -> return
24. Problems with Prototype Chaining
Shared reference and parameter passing issues exist. Solution includes constructor stealing.
25. [Link]
Returns property descriptor of specified object property.