📝 JavaScript Interview Coding Task Question – Day 72 Look at this code snippet 👇 ✅ Answer & Explanation: 1️⃣ Object.create(proto) creates a new object whose prototype is proto. It does not call a constructor function. 2️⃣ So child.name → "Kiran" because JavaScript looks up the prototype chain (since child doesn’t have its own name). 3️⃣ After setting child.name = "Sai", the name property is now created on child itself — it shadows the prototype’s property. 4️⃣ proto.name remains "Kiran", proving that child and proto are independent objects connected by prototype inheritance. ✨ Tip: 👉 Object.create() is great for lightweight inheritance without constructors. 👉 Property lookups follow the prototype chain, but assignments always go to the current object unless explicitly modified on the prototype. #100DaysOfCode #JavaScript #Frontend #WebDevelopment #CodingInterview #JSChallenges #LearnInPublic #DailyCoding #kirantechnophile
Understanding Object.create() in JavaScript: A Coding Task
More Relevant Posts
-
📝 JavaScript Interview Coding Task Question – Day 73 Look at this code snippet 👇 ✅ Answer & Explanation: Parent constructor Child constructor Hello from Parent Hello from Child 1️⃣ The super keyword in classes is used to call methods on the parent class. 2️⃣ In the Child class, the constructor calls super() → this triggers the Parent constructor first before accessing this. 3️⃣ When child.sayHello() is called, it uses the overridden method in Child, but inside it, super.sayHello() invokes the parent’s version. 4️⃣ The output shows how inheritance chains both constructors and methods, combining parent and child logic. ✨ Tip: 👉 Always call super() before using this in a subclass constructor. 👉 super.method() helps reuse parent logic without rewriting it. #100DaysOfCode #JavaScript #Frontend #WebDevelopment #CodingInterview #JSClasses #Inheritance #DailyCoding #LearnInPublic #kirantechnophile
To view or add a comment, sign in
-
-
Here the list of top programming #interview questions: Get all 232 ques & ans for free on interviewdepth.com 1. Reverse a String 2. Check if a String is a Palindrome 3. Remove Duplicates from a String 4. Find the First Non-Repeating Character 5. Count the Occurrences of Each Character 6. Reverse Words in a Sentence 7. Check if Two Strings are Anagrams 8. Find the Longest Substring Without Repeating Characters 9. Convert a String to an Integer (atoi Implementation) 10. Compress a String (Run-Length Encoding) 11. Find the Most Frequent Character 12. Find All Substrings of a Given String 13. Check if a String is a Rotation of Another String 14. Remove All White Spaces from a String 15. Check if a String is a Valid Shuffle of Two Strings 16. Convert a String to Title Case 17. Find the Longest Common Prefix 18. Convert a String to a Character Array 19. Replace Spaces with %20 (URL Encoding) 20. Convert a Sentence into an Acronym 21. Check if a String Contains Only Digits 22. Find the Number of Words in a String 23. Remove a Given Character from a String 24. Find the Shortest Word in a String 25. Find the Longest Palindromic Substring #javascript #javascriptdeveloper #reactjs #reactnative #vuejsdeveloper #angular #angulardeveloper
To view or add a comment, sign in
-
Here the list of top programming #interview questions: Get all these free on interviewdepth.com 1. Reverse a String 2. Check if a String is a Palindrome 3. Remove Duplicates from a String 4. Find the First Non-Repeating Character 5. Count the Occurrences of Each Character 6. Reverse Words in a Sentence 7. Check if Two Strings are Anagrams 8. Find the Longest Substring Without Repeating Characters 9. Convert a String to an Integer (atoi Implementation) 10. Compress a String (Run-Length Encoding) 11. Find the Most Frequent Character 12. Find All Substrings of a Given String 13. Check if a String is a Rotation of Another String 14. Remove All White Spaces from a String 15. Check if a String is a Valid Shuffle of Two Strings 16. Convert a String to Title Case 17. Find the Longest Common Prefix 18. Convert a String to a Character Array 19. Replace Spaces with %20 (URL Encoding) 20. Convert a Sentence into an Acronym 21. Check if a String Contains Only Digits 22. Find the Number of Words in a String 23. Remove a Given Character from a String 24. Find the Shortest Word in a String 25. Find the Longest Palindromic Substring #javascript #javascriptdeveloper #reactjs #reactnative #vuejsdeveloper #angular #angulardeveloper
To view or add a comment, sign in
-
Yesterday, during an interview, I was asked about JavaScript closures. Honestly, I couldn’t explain it properly at that moment. 😅 Afterwards, I took some time to explore it, write some code, and finally understood that a closure is more than just a function — it’s a function that retains access to variables from its outer scope, even after that outer function has finished executing. This small but powerful concept really helped me think more clearly in JavaScript, especially when dealing with data privacy and functional programming. 💡 Key takeaway: Professional growth isn’t just about knowing the right answers—it’s about learning. A small failure often opens the door to bigger learning opportunities. Have you practiced closures? What’s your favorite example? 📝 #JavaScript #Closure #LearningFromExperience #WebDevelopment #ContinuousLearning
To view or add a comment, sign in
-
learn the top 20 javascript concepts every developer must master All explained simply and practically in this tutorial. From hoisting and closures to async/await, event loop, and prototypes, this guide covers everything you need to build a strong foundation in javascript. each concept is explained with key points, making it perfect for beginners, frontend developers, and anyone preparing for javascript interviews. . . . . 📘 what’s inside: ~hoisting and execution context ~this keyword and lexical scope ~promises & async/await ~prototypes & inheritance ~memory management & event loop ~debounce & throttle functions ~destructuring, spread, and rest operators . . . . . . . #javascript #javascripttutorial #learnjavascript #frontenddeveloper #webdevelopment #programming #coding #developerlife #webdeveloper #frontenddevelopment #reactjs #nodejs #webdesign #softwaredevelopment #codingforbeginners #learncoding #javascriptconcepts #asyncawait #closures #eventloop
To view or add a comment, sign in
-
## 🚀 **Top 10 JavaScript Concepts Every Developer Should Know!** 💛 JavaScript is the heart of web development — mastering its core concepts makes you a real problem-solver! Let’s quickly revisit some powerful fundamentals 👇 --- ### 🧩 1️⃣ **Variables (`var`, `let`, `const`)** * `var` → Function-scoped * `let`, `const` → Block-scoped * Use `const` when the value won’t change. ```js let name = "Vijaya"; const age = 25; ``` --- ### ⚡ 2️⃣ **Hoisting** Variables and functions are moved to the top of their scope before execution. ```js console.log(x); // undefined var x = 5; ``` --- ### 🌀 3️⃣ **Closures** A function “remembers” the variables from its parent scope — even after the parent is gone! ```js function outer() { let count = 0; return function inner() { count++; console.log(count); }; } const counter = outer(); counter(); // 1 counter(); // 2 ``` --- ### 🧠 4️⃣ **Promises & Async/Await** Handle asynchronous code neatly. ```js async function getData() { const data = await fetch('https://api.example.com'); console.log('Data loaded!'); } ``` --- ### 🧮 5️⃣ **Array Methods** Powerful one-liners for clean code: * `map()` – transform data * `filter()` – filter elements * `reduce()` – combine values ```js let nums = [1,2,3]; let doubled = nums.map(n => n*2); ``` --- ### 🔁 6️⃣ **Callback Functions** A function passed as an argument to another function. ```js function greet(name, callback) { callback(`Hello ${name}`); } greet("Vijaya", console.log); ``` --- ### 🧱 7️⃣ **Objects & Destructuring** Extract values easily: ```js const user = {name: "Vijaya", age: 22}; const {name, age} = user; ``` --- ### 🔥 8️⃣ **ES6 Features** Modern JavaScript = cleaner syntax! ✅ Template literals ✅ Arrow functions ✅ Spread & Rest operators ✅ Modules ```js const arr = [1, 2]; const newArr = [...arr, 3]; ``` --- ### 🧭 9️⃣ **Event Loop** JS is single-threaded but handles async tasks smartly. 📚 Tasks go to the callback queue and execute when the main thread is free. --- ### 💥 🔟 **DOM Manipulation** Make your webpage dynamic! ```js document.getElementById("demo").innerText = "Hello JS!"; ``` --- ### ✨ **Final Thought** > “Knowing syntax is easy — understanding concepts makes you a real developer.” Keep practicing, keep building 💪 #JavaScript #WebDevelopment #CodingJourney #LearnWithMe #FrontendDeveloper #LinkedInLearning #100DaysOfCode Ajay Babu Sappa 10000 Coders sanjeev ch Manivardhan Jakka
learn the top 20 javascript concepts every developer must master All explained simply and practically in this tutorial. From hoisting and closures to async/await, event loop, and prototypes, this guide covers everything you need to build a strong foundation in javascript. each concept is explained with key points, making it perfect for beginners, frontend developers, and anyone preparing for javascript interviews. . . . . 📘 what’s inside: ~hoisting and execution context ~this keyword and lexical scope ~promises & async/await ~prototypes & inheritance ~memory management & event loop ~debounce & throttle functions ~destructuring, spread, and rest operators . . . . . . . #javascript #javascripttutorial #learnjavascript #frontenddeveloper #webdevelopment #programming #coding #developerlife #webdeveloper #frontenddevelopment #reactjs #nodejs #webdesign #softwaredevelopment #codingforbeginners #learncoding #javascriptconcepts #asyncawait #closures #eventloop
To view or add a comment, sign in
-
👇 💻✨ JavaScript Practice Update! Today I worked on a task using the prompt() and document.write() methods to take multiple inputs from the user and display employee details dynamically on a web page. 🧠 Task Overview: Take inputs such as Employee ID, Name, Email, Phone Number, Salary, Experience, Joining Date, Location, and Designation using prompt(). Display all details in a formatted way using document.write(). ✅ Output Example: Displays all employee details entered by the user directly on the document. 🧩 This exercise helped me understand how to: Capture user input in JavaScript Display formatted data using DOM methods Work with basic string concatenation #JavaScript #FrontendDevelopment #WebDevelopment #LearningJourney #Coding #HTMLCSSJS #Programming #JS #CodingJourney #10000coders #MeghanaM #SpandanaChowdary
To view or add a comment, sign in
-
🚀 JavaScript Methods You Must Know as a Developer JavaScript methods are the building blocks that make coding efficient and powerful. From working with strings and arrays to handling objects, these methods simplify our daily development tasks. Some must-know JS methods include: 📌 map(), filter(), reduce() for arrays 📌 toUpperCase(), slice(), replace() for strings 📌 Object.keys(), Object.values() for objects Understanding these methods will help you write cleaner, faster, smarter code. #JavaScript #WebDevelopment #FrontendDevelopment #JavaScriptConcepts #JavaScriptDeveloper #LearnJavaScript #Coding #Programming #FrontendDeveloper
To view or add a comment, sign in
-
🔥 JavaScript Interview Series(15): Inside the JavaScript Engine: V8 & SpiderMonkey Explained When preparing for advanced JavaScript interviews, understanding how JavaScript engines like V8 (used in Chrome and Node.js) and SpiderMonkey (used in Firefox) work internally can set you apart from average developers. These engines do more than just interpret JavaScript — they compile, optimize, and execute your code using complex architectures and Just-In-Time (JIT) compilation techniques. Let’s dive into 10 real interview questions that test your understanding of JavaScript internals, performance, and optimization strategies. Focus Area: Execution model, JIT compilation Standard Answer: interpreter executes code line-by-line, translating JavaScript directly into bytecode and running it immediately. This is fast for startup but slow for long-running applications. A JIT (Just-In-Time) compiler, on the other hand, compiles frequently executed code (hot paths) into optimized machine code while the program is running, improving performance over time. V8 and SpiderMonkey both use a hybrid https://lnkd.in/gTagtBc4
To view or add a comment, sign in
Explore content categories
- Career
- Productivity
- Finance
- Soft Skills & Emotional Intelligence
- Project Management
- Education
- Technology
- Leadership
- Ecommerce
- User Experience
- Recruitment & HR
- Customer Experience
- Real Estate
- Marketing
- Sales
- Retail & Merchandising
- Science
- Supply Chain Management
- Future Of Work
- Consulting
- Writing
- Economics
- Artificial Intelligence
- Employee Experience
- Workplace Trends
- Fundraising
- Networking
- Corporate Social Responsibility
- Negotiation
- Communication
- Engineering
- Hospitality & Tourism
- Business Strategy
- Change Management
- Organizational Culture
- Design
- Innovation
- Event Planning
- Training & Development
Thanks for the Tip