Marijn Haverbekeã®Eloquent JavaScriptã®ç¿»èš³ã ã¯ãªãšã€ãã£ãã©ã€ã»ã³ã¹
ã³ã¢ã³ãºåž°å±éå¶å©ã©ã€ã»ã³ã¹ ã ã³ãŒãã¯MITã§ã©ã€ã»ã³ã¹ãããŠããŸãã
å 容
- ã¯ããã«
- å€ãã¿ã€ããããã³æŒç®å
- ããã°ã©ã æ§æ
- æ©èœ
- ããŒã¿æ§é ïŒãªããžã§ã¯ããšé å
- é«éé¢æ°
- ãªããžã§ã¯ãã®ç§å¯ã®ç掻
- ãããžã§ã¯ãïŒé»åç掻
- æ€çŽ¢ãšãšã©ãŒåŠç
- æ£èŠè¡šçŸ
- ã¢ãžã¥ãŒã«
- ãããžã§ã¯ãïŒããã°ã©ãã³ã°èšèª
- JavaScriptãšãã©ãŠã¶ãŒ
- ããã¥ã¡ã³ããªããžã§ã¯ãã¢ãã«
- ã€ãã³ãåŠç
- ãããžã§ã¯ãïŒãã©ãããã©ãŒã ã²ãŒã
- ãã£ã³ãã¹ã«æã
- HTTP
- ãã©ãŒã ãšãã©ãŒã ãã£ãŒã«ã
- ãããžã§ã¯ãïŒãã€ã³ã
- Node.js
- ãããžã§ã¯ãïŒçµéšå ±æãŠã§ããµã€ã
- ã³ãŒãã®ãµã³ãããã¯ã¹
ãã®æ¬ã¯ãã³ã³ãã¥ãŒã¿ãŒã«å¿ èŠãªããšããããæ¹æ³ã説æããŠããŸãã çŸåšãã³ã³ãã¥ãŒã¿ãŒã¯ãã©ã€ããŒãšåããããäžè¬çã§ãããè€éãªãã®ãã¯ããã«å€ãå«ãŸããŠãããããç解ãé£ãããæäœãé£ãããªã£ãŠããŸãã å€ãã®äººã«ãšã£ãŠã圌ãã¯ç°è³ªã®ãŸãŸã§ãç©äºããããã«è ãããŠããŸãã
ã³ãã¥ãã±ãŒã·ã§ã³ã®ã®ã£ãããæžããããã®2ã€ã®å¹æçãªæ¹æ³ãèŠã€ããŸãã-瀟äŒçã€ãªãããšé·ãæšè«ã®æèœãæã£ãŠããæ°Žã£ãœãçç©ãšãã³ã³ãã¥ãŒã¿ãŒ-ç¡æå³ãªããŒã¿ãæ±ãç¡æèŠãªãããã¥ã¬ãŒã¿ãŒã 1ã€ã¯ãç©çäžçã®æèŠã«ç®ãåãããããæš¡å£ããã€ã³ã¿ãŒãã§ã€ã¹ãæ§ç¯ããŠãæã䜿çšããŠç»é¢äžã®ãã©ãŒã ãæäœã§ããããã«ããããšã§ãã ã³ã³ãã¥ãŒã¿ãŒãšã®åçŽãªçžäºäœçšã«ãšã£ãŠãããã¯æªããããŸããã
ããããã€ã³ã¿ãŒãã§ã€ã¹ã®èšèšè ãæäŸããªãã£ãåããããŠã¹ã¯ãªãã¯ã®å©ããåããŠãã³ã³ãã¥ãŒã¿ãŒã«è»¢éããè¯ãæ¹æ³ãèŠã€ããããšãã§ããŸããã§ããã ããè€éãªã¬ãã«ã§ã³ã³ãã¥ãŒã¿ãŒãšå¯Ÿè©±ãããããããšãã°ãå®è¡ããä»»æã®ã¿ã¹ã¯ãèŠæ±ããããã«ãã³ãã¥ãã±ãŒã·ã§ã³ã®æèœãããé©ããŠããŸããã³ã³ãã¥ãŒã¿ãŒèšèªãæããŸãã
人éã®èšèªã䜿çšãããšãéåžžã«å€ãã®æ¹æ³ã§åèªãçµã¿åãããããšãã§ãããããéåžžã«å€ãã®ç°ãªãããšãèšãããšãã§ããŸãã ã³ã³ãã¥ãŒã¿èšèªã¯ã»ãŒåãæ¹æ³ã§é 眮ãããŸãããææ³çã«ã¯æè»æ§ããããŸããã
éå»20幎ã«ããã£ãŠãã³ã³ãã¥ãŒã¿ãŒã§ã®äœæ¥ã¯éåžžã«äžè¬çã«ãªããèšèªäžã«æ§ç¯ãããïŒãã€ãŠã³ã³ãã¥ãŒã¿ãŒãšéä¿¡ããå¯äžã®æ¹æ³ã§ãã£ãïŒã€ã³ã¿ãŒãã§ãŒã¹ã¯ãã°ã©ãã£ã«ã«ãªã€ã³ã¿ãŒãã§ãŒã¹ã«ã»ãŒçœ®ãæããããŸããã ãããã圌ãã¯ãŸã ããã«ããŸã-ããªããããããæ¢ãå Žæãç¥ã£ãŠããã°ã ãããã®èšèªã®1ã€ã§ããJavaScriptã¯ãã»ãŒãã¹ãŠã®Webãã©ãŠã¶ãŒã«çµã¿èŸŒãŸããŠãããããã»ãŒãã¹ãŠã®ã³ã³ãã¥ãŒãã£ã³ã°ããã€ã¹ã§äœ¿çšã§ããŸãã
ãã®æ¬ã®ç®çã¯ãã³ã³ãã¥ãŒã¿ã«å¿ èŠãªããšããããããšãã§ããããã«ããã®èšèªãååã«çŽ¹ä»ããããšã§ãã
ããã°ã©ãã³ã°ã«ã€ããŠ
åŠã³ãããªã人ãæè²ããããèªåã§çããæ¢ããããªã人ã奚å±ãããã¯ããŸããã æ£æ¹åœ¢ã®1ã€ã®ã³ãŒããŒã衚瀺ããä»ã®3ã€ã®ã³ãŒããŒã衚瀺ãããªãå Žåãç¹°ãè¿ã説æããå¿ èŠã¯ãããŸããã
åå
JavaScriptã®èª¬æã«å ããŠãããã°ã©ãã³ã°ã®åºæ¬ååã«ã€ããŠã説æããŸãã çµå±ã®ãšãããããã°ã©ãã³ã°ã¯é£ããã§ãã éåžžãåºæ¬ååã¯ã·ã³ãã«ã§ç°¡åã§ãã ãããããããã®ååã«åºã¥ããŠæ§ç¯ãããããã°ã©ã ã¯éåžžã«è€éã«ãªããããç¬èªã®ã«ãŒã«ãšé£æ床ãå°å ¥ãããŸãã ããªãèªèº«ã®è¿·è·¯ãæ§ç¯ãããã®äžã«è¿·åã«ãªãããšãã§ããŸãã
ããããèªæžã¯ããªãã倱æãããã§ãããã ããã°ã©ãã³ã°ãåããŠã®å Žåã¯ãå€ãã®ããšãæ¶åããå¿ èŠããããŸãã å€ãã®çŽ æãçµã¿åããããŠãããŒãéã®æ°ããé¢ä¿ã確ç«ããå¿ èŠããããŸãã
ããªãèªèº«ããããã®åªåã®å¿ èŠæ§ãæ£åœåããªããã°ãªããŸããã æ¬ãèªã¿éãã®ãé£ããå Žåã¯ãèªåèªèº«ã«ã€ããŠã²ã©ãèããå¿ èŠã¯ãããŸããã ããªãã¯ãã¹ãŠå€§äžå€«ã§ã-ããªãã¯ãã åãç¶ããå¿ èŠããããŸãã äŒæ©ãåããæ»ã£ãŠ-åžžã«ãµã³ãã«ããã°ã©ã ãèªãã§ç解ããŠãã ããã ãã¬ãŒãã³ã°ã¯é£ããä»äºã§ãããäœããåŠãã ãããã§ã«ããªãã®ãã®ã§ããããããªãã¹ããããä¿é²ããŸãã
ããã°ã©ããŒã¯ãèªåã ãã責任ãæã€ãŠãããŒã¹ãäœæããŸãã ã³ã³ãã¥ãŒã¿ãŒããã°ã©ã ã§ã¯ãå®è³ªçã«ç¡éã®è€éãã®å®å®ãäœæã§ããŸãã
ãžã§ã»ãã»ã¯ã€ãŒã³ããŠã ããã³ã³ãã¥ãŒã¿ãŒã®åãšäººã ã®å¿ã
ããã°ã©ã ã¯è€éãªæŠå¿µã§ãã ããã¯ããã°ã©ããŒã«ãã£ãŠå ¥åãããããã¹ãã§ããã³ã³ãã¥ãŒã¿ãŒã«äœãã匷å¶ããèªå°åã§ãããã³ã³ãã¥ãŒã¿ãŒã®ã¡ã¢ãªå ã®ããŒã¿ã§ãããåæã«åãã¡ã¢ãªã§äœæ¥ãå¶åŸ¡ããŸãã ããã°ã©ã ãšç§ãã¡ãç¥ã£ãŠãããªããžã§ã¯ããšãæ¯èŒããããšããé¡æšã¯ãéåžžãã¿ã¹ã¯æ¬¡ç¬¬ã§ã¯ãããŸããã å€ããå°ãªããé©ããŠããã®ã¯ãæ©æ¢°ãšã®é¡æšã§ãã å€ãã®å¥åã®éšåã1ã€ã®å šäœãæ§æãããããæ©èœãããããã«ããããã®éšåãçžäºäœçšããæ¹æ³ãšãæ©æ¢°å šäœã®åäœã«ãããããã®ãæ³åããå¿ èŠããããŸãã
ã³ã³ãã¥ãŒã¿ãŒã¯ããããã®ç¡åœ¢ã®ãã·ã³ãå«ãããã«èšèšããããã·ã³ã§ãã ã³ã³ãã¥ãŒã¿ãŒèªäœã¯åçŽãªã¢ã¯ã·ã§ã³ã®ã¿ãå®è¡ã§ããŸãã 圌ãã®å©ç¹ã¯ãéåžžã«è¿ éã«è¡ããããšã§ãã ããã°ã©ã ã¯ãããã®ã¢ã¯ã·ã§ã³ãéåžžã«å·§åŠãªæ¹æ³ã§çµã¿åãããŠãçµæãšããŠéåžžã«è€éãªã¢ã¯ã·ã§ã³ãå®è¡ã§ããŸãã
äžéšã®äººã«ãšã£ãŠãããã°ã©ãã³ã°ã¯æ¥œããã²ãŒã ã§ãã ããã°ã©ã ã¯ã¡ã³ã¿ã«ã³ã³ã¹ãã©ã¯ãã§ãã ãããæ§ç¯ããã®ã«è²»çšã¯ãããããééããããããæã®äžã§ç°¡åã«æé·ããŸãã
泚æããªããšããµã€ãºãšè€éããæã«è² ããªããªãããããæžããŠãã人ã§ããæ··ä¹±ããŸãã ãããããã°ã©ãã³ã°ã®äž»ãªåé¡ã§ããããã°ã©ã ã®å¶åŸ¡ãç¶æããŸãã ããã°ã©ã ãæ©èœãããšããããã¯çŽ æŽãããã§ãã ããã°ã©ãã³ã°ã®æè¡ã¯ãè€éããå¶åŸ¡ããèœåã§ãã 倧èŠæš¡ãªããã°ã©ã ã¯å¶åŸ¡äžã«ãããè€éãã®ç¹ã§åçŽã«å®äºããŸãã
å€ãã®ããã°ã©ããŒã¯ããã®è€éãã¯ããã°ã©ã ã§ããç¥ãããŠããå°æ°ã®ãã¯ããã¯ã䜿çšããŠæé©ã«ç®¡çããããšèããŠããŸãã 圌ãã¯ãããã°ã©ã ãæã€ã¹ã圢åŒã«ã€ããŠã®å³æ Œãªã«ãŒã«ïŒããã¹ããã©ã¯ãã£ã¹ãïŒã説æããŸããã ãããŠããããã®äžã§æãç±å¿ãªäººã¯ããããã®æ £è¡ããéžè±ãã人ãæªãããã°ã©ããšèŠãªããŸãã
è±å¯ãªããã°ã©ãã³ã°ã«å¯Ÿããã©ããªæµæ-ããããçš®é¡ã®å¥åŠã§çŸããããã°ã©ã ãã¿ããŒã«ããããã«ããããççŽã§äºæž¬å¯èœãªãã®ã«è»œèŠããããšããŸãïŒ ããã°ã©ãã³ã°æè¡ã®ã©ã³ãã¹ã±ãŒãã¯å·šå€§ã§ããã®å€æ§æ§ã«é äºãããŠããããŸã ããŸãç 究ãããŠããŸããã ããã¯ãçµéšã®æµ ãããã°ã©ããŒãèªæãæ··ä¹±ãããå±éºãªæ ã§ãããããã¯åã«ãã®éã泚ææ·±ããã©ããé ã§èããªããã°ãªããªãããšãæå³ããŸãã åŠã¶ã«ã€ããŠãããªãã¯åžžã«æ°ããææŠãšæ°ããæªç¥ã®é åã«åºäŒãã§ãããã æ°ããããšãåŠã°ãªãããã°ã©ããŒã¯åæ»ããåã³ãå¿ããä»äºã¯éå±ã«ãªããŸãã
èšèªãéèŠãªçç±
åãã¯ãã³ã³ãã¥ãŒã¿ãŒã®åéã®èªçæã«ãããã°ã©ãã³ã°èšèªã¯ãããŸããã§ããã ããã°ã©ã ã¯æ¬¡ã®ããã«ãªããŸããã
00110001 00000000 00000000 00110001 00000001 00000001 00110011 00000001 00000010 01010001 00001011 00000010 00100010 00000010 00001000 01000011 00000001 00000000 01000001 00000001 00000001 00010000 00000010 00000000 01100010 00000000 00000000
ããã¯ã1ãã10ãŸã§ã®æ°åãè¿œå ããçµæã衚瀺ããããã°ã©ã ã§ãïŒ1 + 2 + ... + 10 = 55ïŒã éåžžã«åçŽãªä»®æ³ãã·ã³ã§å®è¡ã§ããŸãã æåã®ã³ã³ãã¥ãŒã¿ãŒãããã°ã©ã ããã«ã¯ãã¹ã€ããã®å€§ããªé åãç®çã®äœçœ®ã«èšçœ®ãããããã³ãã«ãŒãã«ç©ŽãéããŠã³ã³ãã¥ãŒã¿ãŒã«éã蟌ãå¿ èŠããããŸããã éå±ã§ãšã©ãŒãçºçããããæé ã§ããããšãæ³åã§ããŸãã åçŽãªããã°ã©ã ã§ããããå€ãã®ç¥æ§ãšèŠåŸãå¿ èŠã§ããã è€éãªããã°ã©ã ã¯ã»ãšãã©èããããŸããã§ããã
ãã¡ããããããã®ç¥ç§çãªããããã¿ãŒã³ïŒãŒããš1ïŒãæåã§å ¥åãããšãããã°ã©ãã¯ãŠã£ã¶ãŒãã®ããã«æããããšãã§ããŸããã ãããŠãä»äºã®æºè¶³ãšããæå³ã§äœã䟡å€ããããŸããã
æå®ãããããã°ã©ã ã®åè¡ã«ã¯ã1ã€ã®åœä»€ãå«ãŸããŸãã éåžžã®èšèªã§ã¯ã次ã®ããã«èª¬æã§ããŸãã
- ã¡ã¢ãª0ã«0ãæžã蟌ã
- ã¡ã¢ãª1ã«1ãæžã蟌ã
- ã»ã«1ã®å€ãã»ã«2ã«æžã蟌ã
- ã»ã«2ã®å€ãã11ãåŒã
- ã»ã«2ã®å€ã0ã®å Žåãæé 9ããç¶è¡ããŸãã
- ã»ã«0ã«ã»ã«å€1ãè¿œå ããŸã
- ã»ã«1ã«1ãè¿œå
- ãã€ã³ã3ã«é²ã¿ãŸãã
- ã»ã«å€0ãåºå
ãã®ãªãã·ã§ã³ã¯ãããããã®ããããããèªã¿ãããã§ãããããã§ããŸã ããŸã䟿å©ã§ã¯ãããŸããã åœä»€çªå·ãšã¡ã¢ãªäœçœ®ã®ä»£ããã«ååã䜿çšãããšãç解ãåäžããŸãã
'total' 0 'count' 1 [loop] 'compare' 'count' 11 'compare' 'compare' , [end] 'count' 'total' 1 'count' [loop] [end] 'total'
ä»ã§ã¯ãããã°ã©ã ã®ä»çµã¿ãç解ããããšã¯ããã»ã©é£ãããããŸããã 察åŠã§ããŸããïŒ æåã®2è¡ã¯ã2ã€ã®ã¡ã¢ãªé åã«åæå€ãå²ãåœãŠãŸãã totalã¯èšç®çµæã®èšç®ã«äœ¿çšãããcountã¯çŸåšäœæ¥äžã®æ°ãç£èŠããŸãã ãæ¯èŒãã䜿çšããè¡ã¯ãããããæãå¥åŠãªè¡ã§ãã ããã°ã©ã ã¯ãã«ãŠã³ã11ãã«ãŠã³ãåæ¢ãšçãããªããã©ãããç解ããå¿ èŠããããŸãã æ¶ç©ºã®ãã·ã³ã¯éåžžã«åå§çã§ãããããå€æ°ããŒãã«çãããã©ããã®ãã§ãã¯ã®ã¿ãå®è¡ããå¥ã®è¡ã«ãžã£ã³ããããã©ããã決å®ã§ããŸãã ãããã£ãŠããæ¯èŒããšåŒã°ããã¡ã¢ãªé åã䜿çšããŠcount-11ã®å€ãèšç®ãããã®å€ã«åºã¥ããŠæ±ºå®ãäžããŸãã 次ã®2è¡ã¯ãçµæã«ãŠã³ã¿ãŒã«ã«ãŠã³ããè¿œå ããããã°ã©ã ããŸã 11ã«éããŠããªããšå€æãããã³ã«ã«ãŠã³ãã1ãã€å¢ãããŸãã
åãJavaScriptããã°ã©ã ã次ã«ç€ºããŸãã
var total = 0, count = 1; while (count <= 10) { total += count; count += 1; } console.log(total); // â 55
ããã«ããã€ãã®æ¹åã äž»ãªãã®-ã©ã€ã³éã®é·ç§»ãæåã§ç€ºãå¿ èŠã¯ãããŸããã whileèšèªæ§é ã¯ããããç¬èªã«è¡ããŸãã 圌女ã¯ãæ¡ä»¶ãæºãããããŸã§ïŒcount <= 10ïŒãã€ãŸãcountã®å€ã10以äžã«ãªããŸã§ãäžæ¬åŒ§ã§å²ãŸãããããã¯ã®èšç®ãç¶ããŸããäžæçãªå€ãäœæããŠãŒããšæ¯èŒããå¿ èŠã¯ãªããªããŸããã ããã¯éå±ã§ããããããŠããã°ã©ãã³ã°èšèªã®åã¯éå±ãªè©³çŽ°ãåãé€ãã®ãå©ããããšã§ãã
ããã°ã©ã ã®æåŸã«ãwhileæäœãå®äºãããšãåºåã®ããã«console.logæäœãçµæã«é©çšãããŸãã
ãããŠæåŸã«ã䟿å©ãªç¯å²ããã³åèšæäœãããå Žåãããã°ã©ã ã¯æ¬¡ã®ããã«ãªããŸããããã«ãããç¹å®ã®ééã§äžé£ã®æ°å€ãäœæããèšå®éãèšç®ããŸãã
console.log(sum(range(1, 10))); // â 55
ãã®f話ã®æèšã¯ãåãããã°ã©ã ãé·ããã®ãšçããã®ãèªã¿ããããã®ãšèªã¿ã«ãããã®ã®äž¡æ¹ã§æžãããšãã§ãããšããããšã§ãã ããã°ã©ã ã®æåã®ããŒãžã§ã³ã¯å®å šã«ãããŸãã§ãæåŸã®-ã»ãŒå®éã®èšèª-1ãã10ãŸã§ã®æ°å€ã®ç¯å²ã®åèšãæžãçããŸããã次ã®ç« ã§ã¯ããã®ãããªæ¹æ³ã説æããŸãã
åªããããã°ã©ãã³ã°èšèªã¯ãããã°ã©ããå¿ èŠãªæäœãé«ã¬ãã«ã§ã³ã³ãã¥ãŒã¿ãŒã«éç¥ããã®ã«åœ¹ç«ã¡ãŸãã éå±ãªè©³çŽ°ãçç¥ã§ãã䟿å©ãªãã«ãã£ã³ã°ãããã¯ïŒwhileããã³console.logïŒãæäŸããç¬èªã®ãããã¯ïŒåèšãšç¯å²ïŒãäœæã§ãããããã¯ã®çµåãç°¡åã«ããŸãã
javascriptãšã¯äœã§ããïŒ
JavaScriptã¯ãNetscape Navigatorãã©ãŠã¶ã®WebããŒãžã«ããã°ã©ã ãè¿œå ããæ¹æ³ãšããŠ1995幎ã«å°å ¥ãããŸããã ãã以æ¥ããã®èšèªã¯ãã¹ãŠã®äž»èŠãªã°ã©ãã£ã«ã«ãã©ãŠã¶ã§å®çããŠããŸãã 圌ã¯ããã©ãŠã¶ããŒã¹ã®é»åã¡ãŒã«ã¯ã©ã€ã¢ã³ããå°å³ããœãŒã·ã£ã«ãããã¯ãŒã¯ãªã©ãææ°ã®Webã¢ããªã±ãŒã·ã§ã³ã衚瀺ã§ããããã«ããŸããã ãŸããåŸæ¥ã®ãµã€ãã§ã䜿çšãããåæ¹åæ§ãšããããçš®é¡ã®ä»å æ©èœãä¿èšŒããŸãã
JavaScriptã¯JavaãšåŒã°ããå¥ã®èšèªãšã¯ã»ãšãã©é¢ä¿ããªãããšã«æ³šæããããšãéèŠã§ãã ããŒã±ãã£ã³ã°äžã®çç±ãããåæ§ã®ååãéžæãããŸããã JavaScriptãç»å ŽãããšããJavaèšèªã¯åºã宣äŒããã人æ°ãåããŸããã 誰ãããã®ãšã³ãžã³ã«ããã¿ã€ãã®ããããšæ±ºããã ãããŠä»ãç§ãã¡ã¯ãã®ããã«ã©ãã«ãè¡ããŸããã
èšèªãNetscapeãè¶ ããåŸããã®ãµããŒãã䞻匵ããããŸããŸãªããã°ã©ã ãåãããã«æ©èœããããã«ãèšèªã®äœæ¥ã説æããããã¥ã¡ã³ããäœæãããŸããã ããã¯ãECMAçµç¹ã®ååã§ECMAScriptæšæºãšåŒã°ããŸãã å®éã«ã¯ãECMAScriptãšJavaScriptãåããã®ãšããŠè©±ãããšãã§ããŸãã
å€ãã®äººãJavaScriptãæ¹å€ããããã«ã€ããŠå€ãã®æªãããšãèšã£ãŠããŸãã ãããŠãããã®å€ãã¯çå®ã§ãã åããŠJavaScriptã§ããã°ã©ã ãèšè¿°ããªããã°ãªããªãã£ããšããç§ã¯ããã«ããããããŸãã-èšèªã¯ç§ãæžããã»ãšãã©ãã¹ãŠãåãå ¥ããŸãããããããæå³ãããšããã«è§£éããŸããã§ããã ããã¯äž»ã«ãèªåãäœãããŠããã®ãããããªãã£ããšããäºå®ã«ãããã®ã§ããããåé¡ããããŸãããJavaScriptã¯ãªãã©ã«ãããããã§ãã ããã¯åå¿è åãã®ããã°ã©ãã³ã°ã®ä¿é²ãšããŠèããããŸããã çŸå®ã«ã¯ãã·ã¹ãã ãåé¡ãå ±åããªããããããã°ã©ã å ã®åé¡ãèŠã€ããã®ãé£ãããªããŸãã
æè»æ§ã«ã¯å©ç¹ããããŸãã ããå³å¯ãªèšèªã§ã¯äžå¯èœãªãããŸããŸãªãã¯ããã¯ã®äœå°ãæ®ãããŠããŸãã ãã¢ãžã¥ãŒã«ãã®ç« ã§èŠãããã«ãèšèªã®æ¬ é¥ã®ããã€ããå æããããã«äœ¿çšã§ããå ŽåããããŸãã 圌ãšæ¬åœã«åŠã³ãäžç·ã«ä»äºãããåŸãJavaScriptãæããããã«ãªããŸããã
JavaScriptèšèªã®ããã€ãã®ããŒãžã§ã³ããã§ã«ãªãªãŒã¹ãããŠããŸãã ECMAScript 3ã¯ã2000幎ãã2010幎ãŸã§ã®èšèªã®å°é äžã«åºãæ®åããæ¯é çãªããŒãžã§ã³ã§ããããã®æç¹ã§ãéå¿çãª4çªç®ã®ããŒãžã§ã³ãæºåãããèšèªã®ããã€ãã®æ ¹æ¬çãªæ¹åãšæ¡åŒµãèšç»ãããŠããŸããã ããããæ¿æ²»çãªçç±ã«ãããçããŠãã人æ°ã®ããèšèªãå€æŽããããšã¯éåžžã«é£ãããããŒãžã§ã³4ã®äœæ¥ã¯2008幎ã«äžæ¢ãããŸãããéå¿çãªç¬¬5ããŒãžã§ã³ã¯2009幎ã«ç»å ŽããŸãããæ¬ã
JavaScriptã¯ãã©ãŠã¶ã®ã¿ã§ãµããŒããããŠããŸããã MongoDBãCouchDBãªã©ã®ããŒã¿ããŒã¹ã¯ãã¹ã¯ãªããèšèªããã³ã¯ãšãªèšèªãšããŠäœ¿çšããŸãã ãã¹ã¯ããããšãµãŒããŒçšã®ãã©ãããã©ãŒã ãããã€ããããŸãããæãæåãªãã®ã¯Node.jsã§ããããã©ãŠã¶ãŒå€ã§ããã°ã©ãã³ã°ããããã®åŒ·åãªç°å¢ãæäŸããŸãã
ã³ãŒããšãããã©ãããã
ã³ãŒãã¯ãããã°ã©ã ãæ§æããããã¹ãã§ãã æ¬ã®ã»ãšãã©ã®ç« ã«ã¯ã³ãŒãããããŸãã ã³ãŒãã®èªã¿åããšæžã蟌ã¿ã¯ãããã°ã©ãã³ã°ã®åŠç¿ã«äžå¯æ¬ ãªéšåã§ãã äŸã®ç®ãéãã ãã§ã¯ãªãã泚ææ·±ãèªãã§ç解ããŠãã ããã æåã¯é ããŠç解ã§ããŸããããããã«ã¹ãã«ãç¿åŸã§ããŸãã éåã«ã€ããŠãåãããšãèšããŸãã äœæ¥ããŒãžã§ã³ãäœæãããŸã§ãããããç解ããããšãæå³ããªãã§ãã ããã
ãã£ãŒãããã¯ãããã«åãåãããã«ãå®éã®èšèªã€ã³ã¿ãŒããªã¿ãŒã§ãœãªã¥ãŒã·ã§ã³ãè©Šãããšããå§ãããŸããããã«å®éšããããšãæãã§ããŸãã
Node.jsãã€ã³ã¹ããŒã«ããŠãããã°ã©ã ãå®è¡ã§ããŸãã ããã¯ããã©ãŠã¶ã³ã³ãœãŒã«ã§ãå®è¡ã§ããŸãã 第12ç« ã§ã¯ãããã°ã©ã ãHTMLããŒãžã«åã蟌ãæ¹æ³ã«ã€ããŠèª¬æããŸãã ãã©ãŠã¶ã§ããã°ã©ã ãç°¡åã«å®è¡ã§ããjsbin.comãªã©ã®ãµã€ãããããŸãã æ¬ãµã€ãã«ã¯ã³ãŒãçšã®ãµã³ãããã¯ã¹ããããŸã ã
PSïŒ Amazonã§åœŒã®æ¬ãè³Œå ¥ããããšã§ãå ã®èè ãæ¯æŽã§ããŸã ã 翻蚳ã®èè -èšäºã®äžã«ãããèè ããµããŒãããããšãã圢ã§ã