What does const mean?


#1

Hello please answer my so very very difficult question

hello.

https://www.codecademy.com/courses/react-101/lessons/react-jsx-intro/exercises/jsx-elements-and-surroundings?action=lesson_resume

what is wrong with me

??

i got no code yet

??


#2
  • const is short for contant, which indicates the variable's value won't change.
  • let is the opposite, meaning that the variable's value will change
  • and var is just neutral between the two

There is no code yet because the exercise is asking you to write it from scratch.


#3

const is a new keyword in ES6+. Values assigned to it cannot be changed, however, lists and dictionaries can be. Their variable just cannot be reassigned.

const list = []

list.append('I\'m a change to the list')

console.log(list)    // ['I\'m a change to the list']

#4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.