freeCodeCamp/guide/chinese/javascript/standard-objects/string/index.md

13 lines
736 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

---
title: String
localeTitle: 串
---
## 串
在JavaScript中 `String`全局对象是字符串的构造函数,用于存储一系列字符。字符串可以以文字的形式创建,例如`var greeting = "Hi, campers!";`或使用`String`构造函数: `var greeting = new String("Hi, campers!");`
不像一些其他语言如果你使用一个JavaScript不关心`' '`或双`" "`引号的字符串。你甚至可以_在_字符串中使用它们它们只需要与包含字符串的引号不同`"Isn't that awesome?"` 。
#### 更多信息:
[MDN网络文档](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) [w3schools.com](https://www.w3schools.com/jsref/jsref_obj_string.asp)