diff --git a/examples_book/Chapter03.md b/examples_book/Chapter03.md index 5147553..d9d1c60 100644 --- a/examples_book/Chapter03.md +++ b/examples_book/Chapter03.md @@ -189,7 +189,7 @@ console.log(x); // undefined * หมายเหตุ แสดงผลลัพธ์เหมือนรันใน Node.js ```js var undefined = 55555; -console.log(undefined); // บนเว็บเบราเซอร์จะแสดงเป็น undefined แต่บน Node.js จะแสดงเป็น 55555 +console.log(undefined); // บนเว็บบราวเซอร์จะแสดงเป็น undefined แต่บน Node.js จะแสดงเป็น 55555 var x; console.log(x); // undefined ``` @@ -526,7 +526,7 @@ console.log(typeof undefined); // "undefined" console.log(typeof ''); // "string" console.log(typeof "Hi"); // "string" console.log(typeof (typeof 100) ); // "string" -console.log(typeof null ); // "object" +console.log(typeof null); // "object" console.log(typeof {x: 1, y: 2}); // "object" console.log(typeof [1, 2]); // "object" console.log(typeof function(){ }); // "function" @@ -1126,4 +1126,4 @@ console.log(typeof myFunction2); // undefined (ถ้าไม่ใช่โ "use strict"; var isStrict = (function() { return !this; })( ); console.log(isStrict); // true -``` \ No newline at end of file +``` diff --git a/examples_book/Chapter04.md b/examples_book/Chapter04.md index 3c4f056..53e89c7 100644 --- a/examples_book/Chapter04.md +++ b/examples_book/Chapter04.md @@ -37,7 +37,7 @@ if (true) { while(condition) { statement } -// ถ้ามีประโยคคำสั่งในบอดี้เพียงตัวเดียว ก็สามารถเขียนสั้น ๆ โดยไม่ต้องมีเครื่องหมาย {} ครอบ +// ถ้ามีประโยคคำสั่งในบอดี้เพียงตัวเดียว ก็สามารถเขียนสั้นๆ โดยไม่ต้องมีเครื่องหมาย {} ครอบ while(condition) statement; ``` @@ -58,7 +58,7 @@ while (i < 3) { do { statement } while(condition); -// ถ้ามีประโยคคำสั่งในบอดี้เพียงตัวเดียว ก็สามารถเขียนสั้น ๆ โดยไม่ต้องมีเครื่องหมาย {} ครอบ +// ถ้ามีประโยคคำสั่งในบอดี้เพียงตัวเดียว ก็สามารถเขียนสั้นๆ โดยไม่ต้องมีเครื่องหมาย {} ครอบ do statement while(condition); @@ -81,7 +81,7 @@ do { for ([expr1]; [expr2]; [expr3]) { statement } -// ถ้ามีประโยคคำสั่งในบอดี้เพียงตัวเดียว ก็สามารถเขียนสั้น ๆ โดยไม่ต้องมีเครื่องหมาย {} ครอบ +// ถ้ามีประโยคคำสั่งในบอดี้เพียงตัวเดียว ก็สามารถเขียนสั้นๆ โดยไม่ต้องมีเครื่องหมาย {} ครอบ for ([expr1]; [expr2]; [expr3]) statement; ``` @@ -179,7 +179,7 @@ if (เงื่อนไข_1) { } ... else { // มีหรือไม่มีก็ได้ - ประโยคคำสั่ง_N // เข้ามาทำงานก็ต่อเมื่อไม่ตรงกับเงื่อนไขใด ๆ ใน if ก่อนหน้านี้เลย + ประโยคคำสั่ง_N // เข้ามาทำงานก็ต่อเมื่อไม่ตรงกับเงื่อนไขใดๆ ใน if ก่อนหน้านี้เลย } ``` @@ -488,4 +488,4 @@ try { /* แสดงผลลัพธ์ "Error" "finally" */ -``` \ No newline at end of file +``` diff --git a/examples_book/Chapter05.md b/examples_book/Chapter05.md index 521d048..b32fbc7 100644 --- a/examples_book/Chapter05.md +++ b/examples_book/Chapter05.md @@ -769,7 +769,7 @@ console.log(str); // "a->b->c->d" ```js var array = [ ]; -array.push("a", "b", "c", "d"); // เพิ่มสมาชิกกี่ตัวก็ได้ +array.push("a","b","c","d"); // เพิ่มสมาชิกกี่ตัวก็ได้ console.log(array); // [ 'a', 'b', 'c', 'd' ] console.log(array.pop()); // "d" console.log(array); // [ 'a', 'b', 'c' ] @@ -789,7 +789,7 @@ var result = array.some( function (value, index, arrayObj) { // arrayObj คือ ["a", "b", "c", "d"] return value == "c"; } ); -console.log(result) // true +console.log(result) // true ``` ```js diff --git a/examples_book/Chapter15.md b/examples_book/Chapter15.md index 7544da6..b240272 100644 --- a/examples_book/Chapter15.md +++ b/examples_book/Chapter15.md @@ -129,7 +129,7 @@ function search(value, index, array) { // ฟังก์ชันคอลแ //console.log(array); // [ 'red', 'green', 'blue', 'yellow' ] return value == "blue"; } -let result = a.find(search); +let result = a.find( search ); console.log(result); // 'blue' ``` diff --git a/examples_book/README.md b/examples_book/README.md index 9e7074d..580d594 100644 --- a/examples_book/README.md +++ b/examples_book/README.md @@ -4,7 +4,7 @@ [สามารถสั่งซื้อได้ที่เว็บ MEB (ขายเป็นอีบุ๊ก)](https://www.mebmarket.com/web/index.php?action=BookDetails&data=YToyOntzOjc6InVzZXJfaWQiO3M6NzoiMTcyNTQ4MyI7czo3OiJib29rX2lkIjtzOjY6IjE1Njg1NCI7fQ) -[ หรือสามารถสั่งซื้อได้ที่ shopee](https://shopee.co.th/product/159315996/18595064435/) +[ ส่วนเล่มที่วางขายใน shopee ตอนนี้เลิกทำแล้ว เพราะต้นทุนแพงเกินไปทำไม่ไหว](https://shopee.co.th/product/159315996/18595064435/) * บทที่ 1 แนะนำจาวาสคริปต์ * [บทที่ 2 รันจาวาสคริปต์อย่างง่าย](Chapter02.md) diff --git a/images/cover_new.png b/images/cover_new.png index 5304066..1c9883a 100644 Binary files a/images/cover_new.png and b/images/cover_new.png differ