Object.values()
creates an array from the property values
Object.entries()
makes it simple to use objects in loops
JSON.stringify()
objects can be converted to a string with JSON method
Object Constructor Functions
object type we use an object constructor function.
ex )
function Person(first, last, age, eye) {
this.firstName = first;
this.lastName = last;
this.age = age;
this.eyeColor = eye;
}
const myFather = new Person("John", "Doe", 50, "blue");
Adding a Property to a Constructor
Person.prototype.nationality = "English"; OK
Person.nationality = "English"; CAN NOT
Built-in JavaScript Constructors
new Object() // A new Object object object literals {}
new Array() // A new Array object array literals []
new Map() // A new Map object
new Set() // A new Set object
new Date() // A new Date object
new RegExp() // A new RegExp object pattern literals /()/
new Function() // A new Function object function expressions () {}
HTML Events
EventDescription
onchange | An HTML element has been changed |
onclick | The user clicks an HTML element |
onmouseover | The user moves the mouse over an HTML element |
onmouseout | The user moves the mouse away from an HTML element |
onkeydown | The user pushes a keyboard key |
onload | The browser has finished loading the page |
The list is much longer
Escape Characters
\b | Backspace |
\f | Form Feed |
\n | New Line |
\r | Carriage Return |
\t | Horizontal Tabulator |
\v | Vertical Tabulator |
'JAVASCRIPT' 카테고리의 다른 글
20241122_1 Date Objects (0) | 2024.11.22 |
---|---|
20241121_2 Arrays (0) | 2024.11.21 |
20241121_1 Numbers (2) | 2024.11.21 |
20241120_ String (Methods,Templates) (0) | 2024.11.20 |
20241120_1 기본 (6) | 2024.11.20 |