Like this presentation? Why not share!

# サイ本 文

## by Takashi Takizawa on Mar 02, 2011

• 471 views

サイ本勉強会スライド

サイ本勉強会スライド

### Views

Total Views
471
Views on SlideShare
471
Embed Views
0

Likes
0
0
0

No embeds

### Categories

Uploaded via SlideShare as Apple Keynote

• \n
• \n
• \n
• \n
• \n
• \n
• \n
• \n
• \n
• \n
• \n
• \n
• \n
• \n
• \n
• \n
• \n
• \n
• \n
• \n
• \n
• \n

## サイ本 文Presentation Transcript

• 6
• varvar name_1 [ = value_1 ] [ , ..., name_n [ = value_n ]] → Call →
• functionfunction funcname ([arg1 [, arg2 [..., argn]]]) { statement}
• •••
• function hoge() { huga(); function huga() { console.log("piyopiyo"); }}hoge(); // “piyopiyo”
• returnreturn expression;
• throwthrow expression;
• Q. JavaScriptA.
• Errorfunction hoge() { try { throw "hogehogehgoe"; } catch(e) { console.log(e); }}hoge(); // “hogehogehoge”
• 1.2. catch3.
• try/catch/ﬁnaly ● ●
• try { throw new Error(" "); //}catch(e) { // try console.log(e) // " "}ﬁnaly { // try // try //}
• ﬁnally•• break , continue , return• catch•
• function testﬁnally(a) { try { throw new Error(" "); } ﬁnally { console.log(a); }}testﬁnally("hogehogehogehoge");
• [takashi ~ 09:55 AM] \$ node statement2.jshogehogehogehoge //node.js:63 throw e; ^Error: //
• function testﬁnally(a) { try { throw new Error(" "); } catch(e) { throw new Error(" "); } ﬁnally { console.log(a); throw new Error(" "); }}testﬁnally("hogehogehogehoge");
• [takashi ~ 10:01 AM] \$ node statement2.jshogehogehogehogenode.js:63 throw e; ^Error:
• withwith (object) statement
• with by dankogaihttp://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.js2 // bar1 // foo bar2 // bar
• • with(object) object • object.name name” with() withoutwith() with(Math) with(new Namespace()) ”