Advanced JavaScript functions
You already know how to make certain parts of the code reusable by saving them into a function. You can pass arguments to a function and then refer to them as function parameters....
You already know how to make certain parts of the code reusable by saving them into a function. You can pass arguments to a function and then refer to them as function parameters....
You are already familiar with the for and while loops. I’m going to tell you two ways to break the loop and one way to skip an iteration. Interrupting the loop with return When the keyword return is encountered in the function, it is interrupted and some value is returned to the place where the function was called....
In this article, you’ll learn to handle JavaScript errors and find out why seeing an error isn’t the worst case scenario. If something can go wrong, it will. — Murphy’s Law...
Imagine you have a task at hand: you need to count from 1 to 10 and print each number. Doing this manually is manageable, but what if you had to count to 100 or even 1000?...
In programming, as in life, it is often necessary to change the behavior of a program depending on some external condition. A few examples: If it rains, then use your umbrella....
There are many ways in JavaScript to do the same thing. I will tell you about some nuances that will help you write more beautiful code. One-liner functions When you got acquainted with functions, we told you that you need to place the body of the function in curly braces {....
Programming is all about solving problems efficiently and effectively. Imagine you have a list of tasks that need to be repeated multiple times, like printing the numbers from 1 to 10 or displaying the names of your friends....
We’ve already figured out that programs consist of commands that are executed in order. Top-down. Thus, we can provide the computer with a set of instructions (commands). It will execute them and we will get the expected result....
Today I will tell you about the export command and how you can create programs that consist of multiple files. — Is there a limit on the length of one file in JavaScript?...
One of the most important tasks of a programmer is to write clean and understandable code. Code that’s easy to change and hard to break. Unfortunately, the more complex the problem that the programmer solves, the more complex the code becomes....