Upgrade to Pro — share decks privately, control downloads, hide ads and more …

NCC-JavaScript-Week#1

Irene Chang
October 16, 2015

 NCC-JavaScript-Week#1

NTUST Coding Club JavaScript Course Week#1 (2015.10.16)
For self-study only.

Irene Chang

October 16, 2015
Tweet

More Decks by Irene Chang

Other Decks in Education

Transcript

  1. ‣ +BWB4DSJQU➝稲 ‣ 橇㞯㸞酤 ˋ ‣ 㛇燊铃岁♧  鱒ⴀ莅鱒Ⰵ 

    隶侸  须俲㘗ⴽ侸㶶㶶⚮䋒卌  㘗ⴽ鱲䳖莅焷钢  麌皿㶩  鏽鍑 ‣ 箻绢♧ "HFOEB
  2. “JavaScript is the programming language of HTML and the Web.”

    — w3Schools and the Sever Side language.
  3. “JavaScript is the programming language of HTML and the Web.”

    — w3Schools and the Sever Side language.
  4. Rails, PHP, Java, Python, Node.js … )UNM $44  +BWB4DSJQU

    'SPOUFOEWT#BDLFOE *OTPGUXBSFFOHJOFFSJOH UIFUFSNTGSPOUFOEBOECBDLFOEBSF EJTUJODUJPOT XIJDI SFGFS UP UIF TFQBSBUJPO PG DPODFSOT CFUXFFO B QSFTFOUBUJPOMBZFSBOEBEBUBBDDFTTMBZFSSFTQFDUJWFMZ XJLJ
  5. 4DSJQU垦硹 <html> <head> <title>NCC JavaScript</title> <script type=“text/javascript”> alert(“Hello World!”); </script>

    </head> </html> 欽⢵雊懳錒㐼濼麥䱺♴⢵僽䭸⟂珳铃鎊懳錒 㐼㽠剚䪾鸏♧媯殹⡲僽4DSJQU贖椚罜ꬌ)UNM
  6. 1 var myName = "Irene"; 2 console.log("I am " +

    myName); 㹒デ♧⦐隶侸 "I am Irene"
  7. 1 var myName = "Irene"; 2 console.log("I am " +

    myName); 3 var myName = "Ethan"; 4 console.log("I am " + myName); ꅾ醳㹒デ僽搂㹳涸剚⟃剓倞涸捀⚺ "I am Irene" "I am Ethan"
  8. 1 var a = 1; //數字 2 var b =

    0.01; //數字 3 var c = 'JavaScript'; //字串 4 var d = "JavaScript"; 5 //單引號、雙引號都可以表⽰示字串 6 var e = true; //布林值 7 var f = false; //布林值 8 var g = null; //無值 9 var h = undefined; //未定義
  9. 1 var i = { 2 name: "Irene", 3 school:

    'NTUST', 4 }; 5 //i 是 Object 6 7 var j = ['1', 'JS', 3.14]; 8 //j 是 array
  10. 1 typeof "John" // Returns 'string' 2 typeof 3.14 //

    Returns 'number' 3 typeof false // Returns 'boolean' 4 typeof [1,2,3,4] // Returns 'object' 5 typeof {name:'John', age:34} 6 // Returns 'object' 㘗ⴽ焷钢 ‣ typeof
  11. 1 var name = prompt(); 2 console.log(name); 3 var age

    = prompt("What’s your age?"); 4 console.log("Your age is " + age); 鱒Ⰵ 鱒Ⰵ涸⧩鿪僽㶶⚮ 銴⨞Ⱖ➮欽鸁㽠꨾銴鱲䳖㘗䢀
  12. 皿遯麌皿㶩"SJUINFUJD0QFSBUPST ꤑ✫㛇劥涸麌皿㶩⛓㢫+BWB4DSJQUⰉ䒊.BUI 暟⟝暶䚍涸GVODUJPO䲿⣘⡹刿䓽㣐涸侸㷸麌皿  1 Math.pow(2,3); //Returns 8, 2的3次⽅方 2

    Math.round(0.6); //Returns 1, 四捨五⼊入 3 Math.abs(-10); //Returns 10, 取絕對值 4 Math.max(1,20,30); //Returns 30, 取最⼤大值 5 Math.min(1,20,30) //Returns 1, 取最⼩小值 6 Math.random() //取介於0到1之間的亂數
  13. 䭸崣麌皿㶩"TTJHONFOU0QFSBUPST &YQSFTTJPO &YBNQMF 4BNF"T x = y x = y

    += x += y x = x + y -= x -= y x = x - y *= x *= y x = x * y /= x /= y x = x / y %= x %= y x = x % y =
  14. ⚂"OE 1 true && true; // is true 2 true

    && false; // is false 3 false && true; // is false 4 false && false; // is false
  15. 䧴0S 1 true || true; // is true 2 true

    || false; // is true 3 false || true; // is true 4 false || false; // is false
  16. 鏽鍑$PNNFOU ⴕ䧭㋲遤鏽鍑 // ㄤ㢵遤鏽鍑 /* */  1 // 我是單⾏行註解

    2 /* 我是多⾏行註解 3 我可以有好幾⾏行 4 可以有⾮非常多⾏行 5 要記得結尾唷 */