21 lines
565 B
Markdown
21 lines
565 B
Markdown
|
---
|
|||
|
title: Use * to Import Everything from a File
|
|||
|
localeTitle: 使用*从文件导入所有内容
|
|||
|
---
|
|||
|
## 使用\*从文件导入所有内容
|
|||
|
|
|||
|
如果要从文件导入所有可能的内容,则使用ES6提供的`import * as _ from`语法。这正是你在这次挑战中所做的任务!
|
|||
|
|
|||
|
## 提示1:
|
|||
|
|
|||
|
填写空白: `import * as objName from "file-name"` 。您可以使用`objName` ,但您的文件名应为`capitalize_strings` 。
|
|||
|
|
|||
|
## 剧透警报 - 提前解决!
|
|||
|
|
|||
|
## 解:
|
|||
|
|
|||
|
```javascript
|
|||
|
"use strict";
|
|||
|
import * as str from "capitalize_strings";
|
|||
|
|
|||
|
```
|