อยากใช้เครื่องหมาย Quote ใน String ทำยังไงได้บ้าง ?? มาดูกันเลย 🔥
.
👉 เมื่อเราต้องการกำหนด string ใน JavaScript ทำได้โดยกำหนดข้อความ หรือตัวอักษรให้อยู่ภายใต้ single quote (‘ ’) หรือ double quote (“ ”)
.
⚙️ ตัวอย่างเช่น
single quote (‘ ’)
let str1 = 'With Great power come great responsibility';
.
double quote (“ ”)
let str2 = "Your heart is so full of hatred. You are not fit to be king.";
ขอบคุณประโยคเด็ด ๆ จากภาพยนต์เรื่อง Spiderman และ เรื่อง Black Panther
.
👉 หากเราอยากให้มีเครื่อง Quote (‘ ’ หรือ “ ”) ไว้ใน String สามารถทำได้โดย 2 วิธี ดังนี้
.
🌟 1) ใช้เครื่องหมาย Backslash ( \ ) ก่อนหน้าเครื่องหมายคำพูด (“ ”)
📑 ตัวอย่าง 1
let str = '\"BorntoDev Academy\"';
console.log(str);
//"BorntoDev Academy"
.
📑 ตัวอย่าง 2
let myName = "He said, \" My name is Prayut Chan \".";
console.log(myName);
// He said, " My name is Prayut Chan ".
.
🌟 2) ใช้เครื่องหมาย backticks (`) แทน single quote (‘ ’) หรือ double quote (“ ”) ใน String
.
📑 ตัวอย่าง
let string1 = `We're safely using apostrophes and "quotes" in a template literal.`;
console.log(string1);
// We're safely using apostrophes and "quotes" in a template literal.
.
หวังว่าจะเป็นประโยชน์กับเพื่อน ๆ น้าาาา 🥰
.
borntoDev - 🦖 สร้างการเรียนรู้ที่ดีสำหรับสายไอทีในทุกวัน
#javascript #string #quotes #BorntoDev
同時也有2部Youtube影片,追蹤數超過2,620的網紅themblan,也在其Youtube影片中提到,Resources used: https://www.quickanddirtytips.com/education/grammar/apostrophes-and-plurals?page=1 https://www.dictionary.com/ https://www.merriam-...
「apostrophes」的推薦目錄:
- 關於apostrophes 在 BorntoDev Facebook 的最佳貼文
- 關於apostrophes 在 與芬尼學英語 Finnie's Language Arts Facebook 的精選貼文
- 關於apostrophes 在 Eric's English Lounge Facebook 的精選貼文
- 關於apostrophes 在 themblan Youtube 的最佳解答
- 關於apostrophes 在 男人幫 Youtube 的最讚貼文
- 關於apostrophes 在 Apostrophe 'S - Home | Facebook 的評價
- 關於apostrophes 在 Apostrophes 的評價
apostrophes 在 與芬尼學英語 Finnie's Language Arts Facebook 的精選貼文
"It's more of a crime to have the apostrophes wrong in the first place." 🤣
Meet the self-proclaimed 'grammar vigilante' correcting bad punctuation on shop signs.
(Via BBC Radio Bristol)
apostrophes 在 Eric's English Lounge Facebook 的精選貼文
[英文寫作] 學科的第一個字母應該要大寫嗎 ? No.
常見到同學寫到學科時首字母都會大寫,例如 「I will take Math, Physics, and Literature next semester.」。實際上,是有規則可以參考的。
會犯這個錯誤的主要原因是舊版的英文教科書只會以課表的格式去呈現學科類的單字 ,而並沒有把規則解釋清楚。
★★★★★★★★★★★★
要糾正錯誤,同學需要先釐清兩件事:
1. 課表中首字母會大寫是為了呈現課堂名稱 (例如 Physics 101, Composition 10),在此首字母的確應該要大寫。
Course names should be capitalized.
2. 但是規則卻是學科 (math, science, history) 應該要小寫!!!
A general school subject should not be capitalized unless it is a language (e.g., English, Chinese, etc.).
★★★★★★★★★★★★
偏偏在中小學的基礎教育課程有一些課堂的名稱 (course name->Math) 跟學科 (school subject->math) 是一樣的! 那要怎麼辦? 腦筋昏了吧?
為了避免初學者困惑大小寫的問題,之前的教科書編輯只要一致採用「課表首字母大寫」的呈現方式,學習者就不會看到小寫的學科。
沒有看到的問題當然就不存在了! 學生、老師、編輯大家都開心! 「哈哈哈哈!英文真簡單!」。
然而,結果就是這出於好意的呈現方式反而導致許多同學只要想到學科就一定要大寫,卻忽略了規則。
★★★★★★★★★★★★
以下是美國著名的字典 Merriam-Webster 針對這個常見問題的回應,提供給大家參考 :
★★★★★★★★★★★★
Question:
Do we capitalize school subjects such as math, biology, and chemistry? — Abdul, Saudi Arabia
Answer:
When you are talking about a school subject in a general way, you do not need to capitalize it unless it is the name of a language. For example, math and chemistry do not need to be capitalized, but French and Spanish do need to be capitalized.
When you are talking about the name of a specific class or course, such as Math 241 or Chemistry 100, always capitalize it. Capitalize course titles such as History of the French Revolution and Childhood Psychology.
The following example sentences show when to capitalize a school subject, and when not to.
• I'm taking algebra (學科要小寫) this semester.
• He had always hated biology and chemistry (學科要小寫).
• He decided to take two philosophy (學科要小寫) classes his senior year.
• She studied psychology (學科要小寫) in college.
• They had English (語言要大寫) together two years in a row.
• He is hoping to take French (語言要大寫) next year.
• She was really enjoying geometry (學科要小寫).
• She challenged herself by taking Physics 301 (課堂名稱要大寫).
• His first year in college he took Philosophy of Language, Math 101, and Educational Psychology (課堂名稱要大寫).
Source: http://learnersdictionary.com/qa/When-to-Capitalize-School-Subjects
雖然感覺只是一件小事,但是我相信同學在自己一些正式的文章或申請文件會想要避免這些錯誤。
★★★★★★★★★★★★
Other sources:
We use capital letters when we talk about languages as school subjects – but other subjects don’t have a capital letter.
She’s got exams in English, French, history and geography this year.
Source: https://learnenglish.britishcouncil.org/en/quick-grammar/capital-letters-and-apostrophes
--------------------------
Names of school subjects (math, algebra, geology, psychology) are not capitalized, with the exception of the names of languages (French, English). Names of courses are capitalized (Algebra 201, Math 001).
Source: http://www.umuc.edu/current-students/learning-resources/writing-center/writing-resources/grammar-help/capitalization.cfm
★★★★★★★★★★★★
Rules of Capitalization (大寫規則):
1. https://owl.english.purdue.edu/owl/resource/592/1/
2. https://www.ox.ac.uk/sites/files/oxford/media_wysiwyg/University%20of%20Oxford%20Style%20Guide.pdf
3. https://www.grammarly.com/blog/capitalization-rules/
★★★★★★★★★★★★
標籤或分享給會犯這個錯誤的同學吧~
apostrophes 在 themblan Youtube 的最佳解答
Resources used:
https://www.quickanddirtytips.com/education/grammar/apostrophes-and-plurals?page=1
https://www.dictionary.com/
https://www.merriam-webster.com/
https://en.oxforddictionaries.com/usage/its-or-it-s
----------------------------
Thank you for watching, and have a great day.
----------------------------
Subscribe for more awesome videos! ► https://bit.ly/2M1H2Fy
----------------------------
The song in my intro and outro was done by Hyper Potions, and it is called Time Trials. You can check out the full song here: https://youtu.be/mnfNWe-HHsI.
----------------------------
My Socials:
http://www.twitter.com/themblan1
https://www.instagram.com/themblan1/

apostrophes 在 男人幫 Youtube 的最讚貼文
大部分男士都喜歡figures,但大家有沒有想過擁有一個專屬自己的?原來,前商台DJ王郁開設了3D塑像寫真公司Apostrophe 'S,以3D數碼素描器為大家進行360度全方位素描去製作獨一無二的figures!
http://www.menclub.hk/gadgets-technology/apostrophes

apostrophes 在 Apostrophes 的推薦與評價
3.5 Apostrophes. Learning Objectives. Identify the uses of apostrophes. Correctly use apostrophes in sentences. An apostrophe (') ... ... <看更多>
apostrophes 在 Apostrophe 'S - Home | Facebook 的推薦與評價
Apostrophe 'S. 14512 likes · 1 talking about this. Apostrophe 'S is a 3D Creative Lab based in Hong Kong. Booking At reserve@apostrophes.co. ... <看更多>