M
M
mamaanarhiya2018-03-03 22:40:16
JavaScript
mamaanarhiya, 2018-03-03 22:40:16

When should you use let and when should you use const?

For changing strings - let, but for an array, to which I will then add data via push (), do I also need to specify let or can I const?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Yarkov, 2018-03-03
@mamaanarhiya

If you don't plan to redefine - const You
plan - let
In general, use Eslint, it will kick your ass when you need it.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question