Function.prototype.toSource()
Baseline
Widely available
This feature is well established and works across many devices and browser versions. Itâs been available across browsers since 2015ë 7ì.
ë¹íì¤: ì´ ê¸°ë¥ì íì¤íëì´ ìì§ ììµëë¤. ë¹íì¤ ê¸°ë¥ì ë¸ë¼ì°ì ì§ìì´ ì íì ì´ë©° ë³ê²½ëê±°ë ì ê±°ë ì ìì¼ë¯ë¡ íë¡ëì íê²½ìì ì¬ì©íë ê²ì ê¶ì¥ëì§ ììµëë¤. ê·¸ë¬ë íì¤ ìµì ì´ ìë í¹ì ìí©ììë ì ì í ëìì´ ë ì ììµëë¤.
toSource() ë©ìëë ê°ì²´ì ìì¤ ì½ë를 ëíë´ë ì¤í¸ë§ì ë°íí©ëë¤.
구문
function.toSource();
ë°í ê°
ê°ì²´ì ìì¤ ì½ë를 ëíë´ë ì¤í¸ë§.
ì¤ëª
toSource ë©ìëë ë¤ì ê°ë¤ì ë°íí©ëë¤.
-
ë´ì¥
Functionê°ì²´ì ëítoSource()ë ìì¤ ì½ë ì¬ì©ì´ ë¶ê°í¨ì ëíë´ë ë¤ì ì¤í¸ë§ì ë°íí©ëë¤.jsfunction Function() { [native code] } -
커ì¤í í¨ìì ëí
toSource()ë ê°ì²´ë¥¼ ì ìíë JavaScript ì½ë를 ì¤í¸ë§ì¼ë¡ ë°íí©ëë¤.js// ìì: function hello() { console.log("Hello, World!"); } hello.toSource();js// ê²°ê³¼: "function hello() { console.log(\"Hello, World!\"); }"
ì´ ë©ìëë ë³´íµ JavaScript ì ìí´ ë´ë¶ì ì¼ë¡ í¸ì¶ëë©° ì½ëìì ëª
ìì ì¼ë¡ ì¬ì©ëì§ ììµëë¤. ëë²ê¹
í ë ê°ì²´ì 컨í
ì¸ ë¥¼ ê²ì¬í기 ìí´ toSource 를 í¸ì¶í´ë³´ì¤ ì ììµëë¤.
ëª ì¸ì
ì´ë í íì¤ì ì¼ë¶ë ìëëë¤. JavaScript 1.3 ìì 구íëììµëë¤.