Visitar URL original
javascripting/problems/strings/problem_zh-tw.md at master · SandraWebDev/javascripting · GitHub
Skip to content

Latest commit

 

History

History
29 lines (17 loc) · 582 Bytes

problem_zh-tw.md

File metadata and controls

29 lines (17 loc) · 582 Bytes

字串就是被引號包裹起來的任意的值。

單引號或雙引號效果是一樣的:

'this is a string'

"this is also a string"

注

為了保持一致的風格,本教學中我們將只使用單引號。

挑戰:

建立一個名為 strings.js 的檔案。

在該檔案中像這樣建立一個名為 someString 的變數:

const someString = 'this is a string'

使用 console.log 印出變數 someString 到終端機上。

執行下面的命令來檢查你寫的程式是否正確:

javascripting verify strings.js