number or string(or other immutable types) yes if you define :
                  
                  
                  const a = 10
                  
                  
                  you can not change it because it needs to change the reference but it's not and exception as I said const vars in js are mutable you can not change the reference
                  
                  
                
Ok, first of all. when you assign a number to a variable it's not a reference. That's where the whole misconception you're having starts.
Обсуждают сегодня