Что на самом деле происходит, когда вы вызываете функцию? Наблюдение за стеком вызовов
DEV · 13.11.2026 · 00:22
В этой серии мы используем JSVisualizer для понимания классических алгоритмов, наблюдая за их выполнением. На этот раз мы сосредоточимся на функциях и представлении стека вызовов.
Оригинал
What Really Happens When You Call a Function? Watching the Call Stack
In this series, we use JSVisualizer, a free browser-based tool, to understand classic algorithms by watching them run. Last time we looked at conditionals. This time the topic is functions, and the star of the show is the Call Stack view. Where beginners get stuck This program adds the squares of two numbers. 3 * 3 + 4 * 4 is 25. function square(x) { return x * x; } function sumOfSquares(x, y) { return square(x) + square(y); } let x = 10; let answer = sumOfSquares(3, 4); co