freeCodeCamp/guide/chinese/certifications/javascript-algorithms-and-d.../es6/use--to-import-everything-f.../index.md

565 B
Raw Blame History

title localeTitle
Use * to Import Everything from a File 使用*从文件导入所有内容

使用*从文件导入所有内容

如果要从文件导入所有可能的内容则使用ES6提供的import * as _ from语法。这正是你在这次挑战中所做的任务!

提示1

填写空白: import * as objName from "file-name" 。您可以使用objName ,但您的文件名应为capitalize_strings

剧透警报 - 提前解决!

解:

"use strict"; 
 import * as str from "capitalize_strings";