Primitive values by rule are not objects. However when we treat a primitive type like an object, such as getting the .length of a string, JavaScript will wrap that primitive type into an object. This new object is then linked to the corresponding built-in .prototype, so that we can utilize prototype methods on primitive types.
But there are a lot of methods on strings, ie padEnd.
"Primitive values by rule are not objects. However when we treat a primitive type like an object, such as getting the .length of a string, JavaScript will wrap that primitive type into an object. "
@tyler, what tool/extension do you use to show the console.log values inside the editor?
SO THAT'S WHY I CAN'T CALL STRING.LENGTH. That always bugged me, coming from Ruby.