Why is reading the length property of a string in JavaScript O(1) and not O(n)
Strings are primitives, meaning they don’t actually have methods or properties associated with them. According to MDN
Strings are primitives, meaning they don’t actually have methods or properties associated with them. According to MDN