Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Дополняет ответ на вопрос в статье 'Переменные const, let и var' #5687

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

n1ckdevops
Copy link

Добавление информации к ответу (Интервью JS)

Чек-лист

Copy link

github-actions bot commented Feb 5, 2025

Превью контента из опубликовано.

@vitya-ne vitya-ne changed the title fix: add extra info to var-let answer Дополняет ответ на вопрос в статье 'Переменные const, let и var' Feb 6, 2025
@vitya-ne vitya-ne added улучшение Доработка существующего js Контент по JavaScript собеседование Контент для На собеседовании labels Feb 6, 2025
Comment on lines +43 to +49
const obj = { name: "Nikita" };
obj.name = "Nick"; // объект изменён
obj.age = 25; // добавлено новое свойство

const arr = [1, 2, 3];
arr.push(4); // массив изменён
arr[0] = 10; // элемент изменён
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Давай добавим console.log() после изменения объекта и массива, для наглядности.
Тогда и комментарии к операциям изменения можно убрать:

const arr = [1, 2, 3]
arr.push(4) 
arr[0] = 10

console.log(arr)
// ... результат 

@vitya-ne
Copy link
Contributor

vitya-ne commented Feb 6, 2025

Привет, спасибо за дополнение.
Посмотри, пожалуйста, коммент.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
js Контент по JavaScript собеседование Контент для На собеседовании улучшение Доработка существующего
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants