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();   // “hogehogeho...
1.2.   catch3.
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("hogehog...
[takashi ~ 09:55 AM] $ node statement2.jshogehogehogehoge //node.js:63   throw e;   ^Error:                        //
function testfinally(a) {   try {     throw new Error("                 ");  }  catch(e) {    throw new Error("            ...
[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);          del...
• with(object)        object    • object.name                  name”               with()                            witho...
サイ本 文
Upcoming SlideShare
Loading in …5
×

サイ本 文

600 views

Published on

サイ本勉強会スライド

Published in: Technology, Business
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
600
On SlideShare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • サイ本 文

    1. 1. 6
    2. 2. varvar name_1 [ = value_1 ] [ , ..., name_n [ = value_n ]] → Call →
    3. 3. functionfunction funcname ([arg1 [, arg2 [..., argn]]]) { statement}
    4. 4. •••
    5. 5. function hoge() { huga(); function huga() { console.log("piyopiyo"); }}hoge(); // “piyopiyo”
    6. 6. returnreturn expression;
    7. 7. throwthrow expression;
    8. 8. Q. JavaScriptA.
    9. 9. Errorfunction hoge() { try { throw "hogehogehgoe"; } catch(e) { console.log(e); }}hoge(); // “hogehogehoge”
    10. 10. 1.2. catch3.
    11. 11. try/catch/finaly ● ●
    12. 12. try { throw new Error(" "); //}catch(e) { // try console.log(e) // " "}finaly { // try // try //}
    13. 13. finally•• break , continue , return• catch•
    14. 14. function testfinally(a) { try { throw new Error(" "); } finally { console.log(a); }}testfinally("hogehogehogehoge");
    15. 15. [takashi ~ 09:55 AM] $ node statement2.jshogehogehogehoge //node.js:63 throw e; ^Error: //
    16. 16. function testfinally(a) { try { throw new Error(" "); } catch(e) { throw new Error(" "); } finally { console.log(a); throw new Error(" "); }}testfinally("hogehogehogehoge");
    17. 17. [takashi ~ 10:01 AM] $ node statement2.jshogehogehogehogenode.js:63 throw e; ^Error:
    18. 18. withwith (object) statement
    19. 19. with by dankogaihttp://blog.livedoor.jp/dankogai/archives/51066288.html
    20. 20. 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
    21. 21. • with(object) object • object.name name” with() withoutwith() with(Math) with(new Namespace()) ”

    ×