We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
// module.js export default () => 'Hello world' export const name s 'Lydia' // index.js import * as data from './module' console.log(data)
A:{ default: function default(), name: "Lydia"} B: { default: function default() } C: { default: "Hello world", name: "Lydia"} D: Global object of module.js
答案:A
解析:
使用import * as name语法,我们将module.js文件中所有export导入到index, js文件中,并且创建了一个名为data的新对象。在module.js文件中,有两个导出:默认导出和命名导出,默认导出是一个返回字符串'Hello world'的函数,命名导出是一个名为name的变量,其值为字符串 'Lydia'。
data对象具有默认导出的default属性,其他属性具有指定exports的名称及其对应的值
The text was updated successfully, but these errors were encountered:
const name s 'Lydia' 这个s是什么写法
Sorry, something went wrong.
No branches or pull requests
答案:A
解析:
使用import * as name语法,我们将module.js文件中所有export导入到index, js文件中,并且创建了一个名为data的新对象。在module.js文件中,有两个导出:默认导出和命名导出,默认导出是一个返回字符串'Hello world'的函数,命名导出是一个名为name的变量,其值为字符串
'Lydia'。
data对象具有默认导出的default属性,其他属性具有指定exports的名称及其对应的值
The text was updated successfully, but these errors were encountered: