170 читали · 1 месяц назад
Язык JavaScript - Качество кода
Вы написали код. Он не работает. Вы добавляете console.log('тут'). Потом ещё один. Потом console.log('сюда доходит?'). Через час вы окружены лесоповалом из сообщений в консоли, а баг всё ещё здесь. Я знаю эту боль. Мы все через это проходили. Но есть путь джедая. Инструменты отладки в браузере - это не магия для избранных. Это мощный арсенал, который превращает поиск ошибок из гадания на кофейной гуще в детективное расследование с лупой, отпечатками пальцев и замедленной съёмкой. Вы знаете console...
4 года назад
Introduction to JavaScript
Console The console is a panel that displays important messages, like errors, for developers. Much of the work the computer does with our code is invisible to us by default. When we write console.log() what we put inside the parentheses will get printed, or logged, to the console. It’s going to be very useful for us to print values to the console, so we can see the work that we’re doing. console.log(5); // 5 printed Comments There are two types of code comments in JavaScript: // Prints 5 to the console console.log(5); console.log(5);  // Prints 5 console.log(/*IGNORED!*/ 5);  // Still just prints 5 Data types: The first 6 of those types are considered primitive data types...