JS

JavaScript ES6 - Modules and the import/export

12.

Examine the following JavaScript ES6 code:

// greet.js
export function sayHello(name) {
    return `Hello, ${name}!`;
}
// app.js
import * as allGreetings from './greet.js';
console.log(allGreetings.sayHello('Sarah'));

What will the console statement output when running the app.js file in a Node.js environment?

Error: Cannot find module './greet.js'

greet.js

sayHello('Sarah')

Hello, Sarah!