Skip to content

athulharilal/js_interview_questions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

JavaScript Code Samples and Explanations This repository contains JavaScript code samples along with detailed explanations for various concepts and scenarios. Each code snippet is accompanied by comments and explanations to help you understand the behavior of the code.

Code Samples

  1. Overwriting Functions File: overwriting_functions.js Description: Demonstrates how function declarations are hoisted and overwritten in JavaScript. Shows that the last function declaration takes precedence.
  2. Variable Hoisting and Scope File: variable_hoisting_and_scope.js Description: Illustrates variable hoisting and scope in JavaScript. Explains how the last declared function influences the output.
  3. Variable and Function Declarations File: variable_and_function_declarations.js Description: Highlights the importance of understanding hoisting. Demonstrates the impact of function declaration hoisting on variables.
  4. Hoisting and Scope in Nested Functions File: hoisting_and_scope_in_nested_functions.js Description: Explores the behavior of variables in nested functions. Shows how the scope chain works and affects variable access.
  5. Function Invocation and Closure File: function_invocation_and_closure.js Description: Introduces the concept of closures in JavaScript. Explains how inner functions retain access to outer function variables.
  6. Prototype and Inheritance File: prototype_and_inheritance.js Description: Demonstrates prototypal inheritance in JavaScript. Shows how objects inherit properties and methods from their prototypes.
  7. Modifying Prototypes Dynamically File: modifying_prototypes_dynamically.js Description: Illustrates how prototypes can be dynamically modified. Demonstrates the impact on instances created from the constructor.
  8. Currying in JavaScript File: currying_in_javascript.js Description: Explains the concept of currying in JavaScript. Demonstrates how to create partially applied functions using currying.

How to Use.

1.Clone the repository to your local machine: git clone https://github.com/your-username/javascript-code-samples.git

2.Navigate to the specific code snippet you are interested in: cd javascript-code-samples

3.Open the corresponding JavaScript file in your preferred code editor. 4.Read the comments and explanations within the code file to understand the concepts being demonstrated.

Creator This repository was created by Nisham Mahsin. https://www.linkedin.com/in/nisham-mahsin-79004256/

Feel free to explore and use these code samples to enhance your understanding of JavaScript concepts.

About

This repo got some questions prepared by Nisham Mahsin

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors