Property
- When you introduce a new piece of data into a JavaScript program, the browser saves it as an instance of the data type. Every string instance has a property called length that stores the number of characters in that string. You can retrieve property information by appending the string with a period and the property name.
console.log('hello'.length)
Methods
Difference between properties and methods
This breaks down to two levels, the top level, Object and the secondary level, String. .length is an attribute of the Object class, and since that is the top of the prototype chain, all subclasses can reach up the chain to the length attribute.
Attributes that are values have no functionality, but those that are methods do have it. Be sure to reach out to MDN for a greater understanding of String methods, Object.prototype, and other JS concepts.
Built-in Objects or Standard objects
Object, String, Number, Function, Array, RegExp, Date, Math
네이티브 객체를 Global Objects라고 부르기도 하는데 이것은 전역 객체(Global Object)와 다른 의미로 사용되므로 혼동에 주의하여야 한다.
전역 객체(Global Object)는 모든 객체의 최상위 객체를 의미하며 일반적으로 Browser-side에서는 window, Server-side(Node.js)에서는 global 객체를 의미한다.
On client side, Global Object refers to window and regular objects in global scope on serverside.