Learning about string and number immutability
If string is 'effectively' an immutable array of characters ['B', 'o', 'b'] then is this true for number data type?
Cannot seem to access the first digit 1 with console.log(immutableNumber[0]); as I did above with the string data type above.
var immutableString = "Bob"; // string 'effectively' an immutable array of characters ['B', 'o', 'b']
immutableString[0] = "Job";
console.log(immutableString[0]); // B
console.log(immutableString); // Bob
var reassignedString = "Bob";
reassignedString = "Job";
console.log(reassignedString); // Job
var immutableNumber = 123456; // is number 'effectively' an immutable array of characters? ['1', '2', '3', '4', '5', '6']
immutableNumber[0] = "7890";
console.log(immutableNumber[0]); // undefined - why not 1?
console.log(immutableNumber); //123456
var reassignedNumber = "123456";
reassignedNumber = "789101";
console.log(reassignedNumber); // 789101
Can I ask is there a guide for how JS treats the different primitives?