JS Properties + method + Built in Object

Yoseob Shin·2022년 3월 18일
0

javascript

목록 보기
2/24
post-thumbnail
post-custom-banner

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

  • methods are actions we can perform. JavaScript provides a number of string methods.
    -Iterables include arrays, sets and strings.

Difference between properties and methods

  • Similar notation, but different functionality. All objects have a length property, though some of them are fixed at zero (not iterable). Only strings have a .toLowerCase() and .trim() method.

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.

profile
coder for web development + noodler at programming synthesizers for sound design as hobbyist.
post-custom-banner

0개의 댓글