SlideShare a Scribd company logo
6
サイ本 文
var
var name_1 [ = value_1 ] [ , ..., name_n [ = value_n ]]

                   → Call
        →
function
function funcname ([arg1 [, arg2 [..., argn]]]) {
    statement
}
•
•



•
function hoge() {
   huga();
   function huga() {

     console.log("piyopiyo");
   }
}

hoge(); // “piyopiyo”
return
return expression;
throw
throw expression;
Q. JavaScript

A.
Error

function hoge() {
   try {

     throw "hogehogehgoe";
   }
   catch(e) {

     console.log(e);
   }
}

hoge();   // “hogehogehoge”
1.


2.   catch


3.
try/catch/finaly
  ●   ●
try {
   throw new Error("          ");
    //
}
catch(e) {
   // try
    console.log(e) // "   "
}
finaly {
  // try
    // try
    //
}
finally


•
• break   , continue , return



• catch
•
function testfinally(a) {
   try {

    throw new Error("            ");
  }
  finally {

   console.log(a);
  }
}

testfinally("hogehogehogehoge");
[takashi ~ 09:55 AM] $ node statement2.js
hogehogehogehoge //

node.js:63
   throw e;
   ^
Error:                        //
function testfinally(a) {
   try {

     throw new Error("                 ");
  }
  catch(e) {

    throw new Error("            ");
  }
  finally {

   console.log(a);

   throw new Error("                         ");
    }
}

testfinally("hogehogehogehoge");
[takashi ~ 10:01 AM] $ node statement2.js
hogehogehogehoge

node.js:63
   throw e;
   ^
Error:
with
with (object)
 statement
with
                        by dankogai
http://blog.livedoor.jp/dankogai/archives/51066288.html
var foo = { bar : 1 };
       var bar = 2;
       console.log(bar);
       with(foo){
          console.log(bar);
          delete foo['bar'];
          console.log(bar);
       }
[takashi ~ 10:10 AM] $ node dankogai1.js
2 //       bar
1 // foo              bar
2 //       bar
• with(object)        object

    • object.name                  name
”               with()                            without
with()


         with(Math)   with(new Namespace())


                                              ”

More Related Content

PDF
Debugging JavaScript with Chrome
DOCX
Jose dossantos.doc
PDF
JavaSE7 Launch Event: Java7xGroovy
PDF
Jakarta Commons - Don't re-invent the wheel
PDF
Finch + Finagle OAuth2
PDF
No dark magic - Byte code engineering in the real world
Debugging JavaScript with Chrome
Jose dossantos.doc
JavaSE7 Launch Event: Java7xGroovy
Jakarta Commons - Don't re-invent the wheel
Finch + Finagle OAuth2
No dark magic - Byte code engineering in the real world

What's hot (20)

PDF
Продвинутая отладка JavaScript с помощью Chrome Dev Tools
PDF
3 rd animation
KEY
JavaScript @ CTK
PDF
Goの時刻に関するテスト
PPTX
JavaScript Event Loop
PDF
Async Microservices with Twitter's Finagle
PDF
LINE iOS開発で実践しているGit tips
PPTX
2015 555 kharchenko_ppt
PPTX
Call stack, event loop and async programming
PPTX
Interface record comparator
PPT
DATASTRUCTURES PPTS PREPARED BY M V BRAHMANANDA REDDY
PDF
Biicode OpenExpoDay
ODT
Spatial script for MongoBoulder
PDF
Real world scala
PPTX
QA Fest 2019. Saar Rachamim. Developing Tools, While Testing
PDF
Javascript compilation execution
PPTX
Commit2015 kharchenko - python generators - ext
PDF
Create LED lightened Wapuu (LEDパネルで光るわぷーを)
PDF
2016 gunma.web games-and-asm.js
Продвинутая отладка JavaScript с помощью Chrome Dev Tools
3 rd animation
JavaScript @ CTK
Goの時刻に関するテスト
JavaScript Event Loop
Async Microservices with Twitter's Finagle
LINE iOS開発で実践しているGit tips
2015 555 kharchenko_ppt
Call stack, event loop and async programming
Interface record comparator
DATASTRUCTURES PPTS PREPARED BY M V BRAHMANANDA REDDY
Biicode OpenExpoDay
Spatial script for MongoBoulder
Real world scala
QA Fest 2019. Saar Rachamim. Developing Tools, While Testing
Javascript compilation execution
Commit2015 kharchenko - python generators - ext
Create LED lightened Wapuu (LEDパネルで光るわぷーを)
2016 gunma.web games-and-asm.js
Ad

Similar to サイ本 文 (16)

KEY
谈谈Javascript设计
KEY
谈谈Javascript设计
KEY
Node.js - Best practices
PDF
Khan Academy Computer Science
KEY
第7回みゆっき☆Think 本気で学ぶ JavaScript
KEY
みゆっき☆Think#7 「本気で学ぶJavascript」
PPTX
JavaScript (without DOM)
PDF
Es.next
PDF
JavaScript The Definitive Guide 7th Edition David Flanagan
PDF
To Err Is Human
PDF
Graph-Based Source Code Analysis of JavaScript Repositories
PDF
Clean & Typechecked JS
PDF
Kamil witecki asynchronous, yet readable, code
PPTX
JavaScript Gotchas
PDF
JavaScript Good Practices
PPTX
node.js errors
谈谈Javascript设计
谈谈Javascript设计
Node.js - Best practices
Khan Academy Computer Science
第7回みゆっき☆Think 本気で学ぶ JavaScript
みゆっき☆Think#7 「本気で学ぶJavascript」
JavaScript (without DOM)
Es.next
JavaScript The Definitive Guide 7th Edition David Flanagan
To Err Is Human
Graph-Based Source Code Analysis of JavaScript Repositories
Clean & Typechecked JS
Kamil witecki asynchronous, yet readable, code
JavaScript Gotchas
JavaScript Good Practices
node.js errors
Ad

Recently uploaded (20)

PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Modernizing your data center with Dell and AMD
PDF
NewMind AI Monthly Chronicles - July 2025
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Empathic Computing: Creating Shared Understanding
PDF
Electronic commerce courselecture one. Pdf
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
cuic standard and advanced reporting.pdf
PDF
Unlocking AI with Model Context Protocol (MCP)
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Spectral efficient network and resource selection model in 5G networks
PPTX
Cloud computing and distributed systems.
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
NewMind AI Weekly Chronicles - August'25 Week I
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Modernizing your data center with Dell and AMD
NewMind AI Monthly Chronicles - July 2025
Network Security Unit 5.pdf for BCA BBA.
Review of recent advances in non-invasive hemoglobin estimation
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Empathic Computing: Creating Shared Understanding
Electronic commerce courselecture one. Pdf
The AUB Centre for AI in Media Proposal.docx
Building Integrated photovoltaic BIPV_UPV.pdf
cuic standard and advanced reporting.pdf
Unlocking AI with Model Context Protocol (MCP)
Understanding_Digital_Forensics_Presentation.pptx
Spectral efficient network and resource selection model in 5G networks
Cloud computing and distributed systems.
Advanced methodologies resolving dimensionality complications for autism neur...
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Chapter 3 Spatial Domain Image Processing.pdf
Per capita expenditure prediction using model stacking based on satellite ima...

サイ本 文

Editor's Notes