David Gostindgostin.hashnode.dev·Nov 7, 2024The Event Loop and Call Stack in JavascriptAbsolutely! Let’s go through some examples to understand how the event loop and call stack work together in JavaScript. Key Concepts Call Stack: Keeps track of functions in execution. It works in a Last In, First Out (LIFO) manner. Event Loop: Mana...Event Loop
Gautham R Vanjregautham10.hashnode.dev·Jan 26, 2024Behind the Scenes: Understanding JavaScript Code ExecutionIntroduction In the fast-paced world of web development, understanding how JavaScript code is executed is crucial. This article will take you on a journey behind the scenes, unravelling the mysteries of the JavaScript code execution process. By the e...1 like·65 readsUnderstanding JavascriptJavaScript
v likeblog.iread.fun·Jan 22, 2024Js 不导致栈溢出的递归函数堆栈溢出 递归函数(Recursive Function)如果调用自身次数过多,超过栈大小限制,就会导致栈溢出。 一个典型的例子是,用递归函数简陋实现斐波那契数列,如果调用参数过大,将导致栈溢出: function fibonacci(n) { if (n < 2) return n; return fibonacci(n - 1) + fibonacci(n - 2); } for (let n = 0; n < 100; n++) { console.log(`fibo ${n...31 readsJavaScript
v likeblog.iread.fun·Jan 22, 2024Recursive functions don't casue stack overflow in JSStack Overflow Recursive functions can cause a stack overflow if they call themselves too many times and exceed the stack size limit. A classic example of a recursive function that can exceed the stack size limit if called with a large input is the n...JavaScript
Amina Arifaminablogs.hashnode.dev·Jun 14, 2023How JS is executed?When JavaScript code is executed, an execution context is created. This process involves two main steps: the memory allocation phase and the code execution phase. During the creation of the global execution context, which represents the global scope ...39 reads2Articles1Week
Nikblog.xnim.me·Mar 12, 2023JS: Call stack size exceededSome time ago I was working with big arrays of about 2.000.000 elements. One of the operations was to find the maximum value in the array. Sounds simple, right? We can use Max.max: const arr = new Array(2000000); ... const max = Math.max(...arr); Ho...2 likes·473 readsJavaScript
Ashish Jhaashishjha14.hashnode.dev·Jan 20, 2023The flow of Code Execution in JavascriptJavascript is a language designed for the Web, Everything that happens in it, happens in an Execution Context. If a program runs in javascript an execution context is created. Everytime an execution context is created it is created in two phases. Cre...94 readscall stack
Nihal Siddiquimrdecoder.hashnode.dev·Sep 10, 2022An interview preparation cheat sheet.1 . Scope JavaScript has the following kinds of scopes: Global scope Module scope In addition, variables declared with let or const can belong to an additional scope Block scope: The scope created with a pair of curly braces { let x = "In With...3 likes·123 readsScope