Baseline Widely available
ìì± ì ê·¼ìë ì ëë ê´í¸ í기ë²ì¼ë¡ ê°ì²´ì ìì±ì ì ê·¼í ì ìëë¡ í´ì¤ëë¤.
ìëí´ ë³´ê¸°const person1 = {};
person1["firstname"] = "Mario";
person1["lastname"] = "Rossi";
console.log(person1.firstname);
// Expected output: "Mario"
const person2 = {
firstname: "John",
lastname: "Doe",
};
console.log(person2["lastname"]);
// Expected output: "Doe"
구문
object.property;
object["property"];
ì¤ëª
ê°ì²´ë ìì±ì ì´ë¦ì í¤ë¡ ì¬ì©íë ì°ê´ ë°°ì´(ë¤ë¥¸ ì´ë¦ì¼ë¡ë ë§µ, ëì
ë리, í´ì, 룩ì
í
ì´ë¸)ë¡ ìê°í ì ììµëë¤. ë³´íµ ê°ì²´ì ìì±ì ë©ìëì 구ë³í´ì ë§í곤 íì§ë§, ìë¡ì ì°¨ì´ë ê´ë¡ì ë¶ê³¼í©ëë¤. ë©ìëë í¸ì¶í ì ìë ìì±ì¼ ë¿ì¼ë¡, ìì±ì ê°ì´ Function
ì ê°ë¦¬í¤ë 참조ë¼ë©´ ê·¸ ìì±ì ë©ìëë¼ê³ í©ëë¤.
ìì±ì ì ê·¼íë ë²ì ì í기ë²ê³¼ ê´í¸ íê¸°ë² ë ê°ì§ê° ììµëë¤.
ì í기ë²get = object.property;
object.property = set;
ì´ ì½ëìì, property
ë ì í¨í JavaScript ìë³ìì¬ì¼í©ëë¤. ë°ë¼ì object.$1
ì ì í¨íì§ë§ object.1
ì ìëëë¤.
document.createElement("pre");
ì¬ê¸°ìë "createElement"ë¼ë ì´ë¦ì ê°ì§ ë©ìë를 document
ìì ì°¾ì í¸ì¶íê³ ììµëë¤.
ìì«ì ìë ì«ì 리í°ë´ì ë©ìë를 í¸ì¶íê³ ì¶ì¼ë©´, ë©ìëì ì ê·¼ì ìì 공백ì í 칸 ì¶ê°í´ ì ì´ ìì«ì ì¼ë¡ ì¸ìëì§ ìëë¡ í´ì¼ í©ëë¤.
(77).toExponential();
// or
(77).toExponential();
// or
(77).toExponential();
// or
(77).toExponential();
// or
(77.0).toExponential();
// because 77. === 77.0, no ambiguity
ê´í¸ í기ë²
get = object[property_name];
object[property_name] = set;
ê´í¸ í기ë²ììë property_name
ì¼ë¡ 문ìì´ì´ë Symbol
ì ì¬ì©í ì ììµëë¤. 문ìì´ì ì í¨í ìë³ìê° ìëì´ë ê´ì°®ìµëë¤. "1foo
", "!bar!
", ì¬ì§ì´ " "(공백)ë ê°ë¥í©ëë¤.
document["createElement"]("pre");
ì´ ì½ëë ì í기ë²ì ììì ëì¼í©ëë¤.
ê´í¸ ìì ê³µë°±ì´ ì¬ ìë ììµëë¤.
document["createElement"]("pre");
ìì± ì´ë¦
ìì±ì ì´ë¦ì 문ìì´ì´ë Symbol
ì
ëë¤. ì«ì ë±ì ë¤ë¥¸ ìë£íì 문ìì´ë¡ ë³íë©ëë¤.
var object = {};
object["1"] = "value";
console.log(object[1]);
ì ì½ëì 1
ì '1'
ë¡ ë³íëë¯ë¡, ì¶ë ¥ ê²°ê³¼ë "value"ì
ëë¤.
var foo = { unique_prop: 1 },
bar = { unique_prop: 2 },
object = {};
object[foo] = "value";
console.log(object[bar]);
ìì ì½ë ìì foo
ì bar
ê° ê°ì 문ìì´(SpiderMonkey JavaScript ìì§ììë 문ìì´ "['object Object']
")ë¡ ë³íëë¯ë¡, ì¶ë ¥ ê²°ê³¼ë ëì¼íê² "value"ì
ëë¤.
ë©ìëë í´ë¹ ë©ìëì ê°ì²´ì ë°ì¸ë©ëì§ ììµëë¤. í¹í this
ë ë©ìë ë´ì ê³ ì ëì§ ìì¼ë¯ë¡ this
ê° íì íì¬ ë©ìë를 í¬í¨íë ê°ì²´ë¥¼ 참조íëê±´ ìëëë¤. ëì , this
ë í¨ì í¸ì¶ ë°©ìì ë°ë¼ "ì ë¬"ë©ëë¤. ë©ìë ë°ì¸ë©ì ì°¸ê³ íì¸ì.
eval()
주ìì¬í
JavaScript ì´ì¬ìë¡ì¨ë ê´í¸ í기ë²ì ì¬ì©í ì ìë ì¥ìì eval()
ì ë¨ì©í기 ì½ìµëë¤. ê°í¹ ì¤í¬ë¦½í¸ìì ë¤ìê³¼ ê°ì 구문ì ì°¾ìë³¼ ì ììµëë¤.
x = eval("document.forms.form_name.elements." + strFormControl + ".value");
eval()
ì ëë¦¬ê³ , ê°ë¥íë¤ë©´ ìµëí í¼í´ì¼ í©ëë¤. ëí, strFormControl
ì ì í¨í ìë³ìì¬ì¼ íì§ë§, í¼ ì»¨í¸ë¡¤ì IDë ì´ë¦ì ìë³ìê° ìë ìë ììµëë¤. ë°ë¼ì ê´í¸ í기ë²ì ëì ì¬ì©íë ê²ì´ ì¢ìµëë¤.
x = document.forms["form_name"].elements[strFormControl].value;
ëª
ì¸ì ë¸ë¼ì°ì í¸íì± ê°ì´ 보기
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4