[JavaScript] Object
![[JavaScript] Object](/_next/image?url=https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1681446209251%2F8cfa4cf2-3f85-4756-8435-5788534717ab.png&w=3840&q=75)
Object
JavaScript's data types can be broadly classified into primitive types and object types.
Primitive types represent a single value, and the values of primitive types are immutable or unchangeable.
Object types are complex data structures composed of various types of values as a single unit, and the values of object types are mutable or changeable.
JavaScript is an object-based programming language, and almost everything in JavaScript is composed of objects. An object is a collection of zero or more properties where each property is composed of a key and a value.
When a function is declared as a value in the object, it is called a method.
Object Literal
A literal is a notation used to create a value using human-readable characters or agreed-upon symbols.
In JavaScript, an object literal is a notation used to create an object. It can be written with {}.
let objectLiteral = {
key: 'Value', // Property
helloWorld: function () { // Method
return "Hello world";
}
};
console.log(objectLiteral.helloWorld()); // Hello world
![[코테] 그리디 문제 - 무지의 먹방 라이브](/_next/image?url=https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1712215455263%2F1ac1f35a-8862-4e42-8d0c-e2bea01e04c0.png&w=3840&q=75)
![[코테] Bfs 토마토](/_next/image?url=https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1709032619170%2F70056896-c857-444b-9c99-45bfcb466806.png&w=3840&q=75)
![[코테] Dfs 문제 유형 - 그래프 내에서 구분하여 카운트 하기](/_next/image?url=https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1709019361383%2Fb0585d72-c808-4169-83a9-2724f312e927.png&w=3840&q=75)
![[코테] DFS vs BFS](/_next/image?url=https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1708971211123%2F71f9386c-6a62-43b2-a602-4d084c24d6cf.png&w=3840&q=75)
![[코테] 여행경로](/_next/image?url=https%3A%2F%2Fcdn.hashnode.com%2Fres%2Fhashnode%2Fimage%2Fupload%2Fv1708971251412%2F27ce72ed-8ee7-4d13-a02f-ff4bbe50c4be.png&w=3840&q=75)