Created
July 17, 2022 15:23
-
-
Save faustoct1/ccfe4a58c570939568b4e8b0af36bf6c to your computer and use it in GitHub Desktop.
Exportar e importar múltiplas funções no mesmo arquivo js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const {hello,espaco,world,helloworld} = require('./modulos') | |
const test = () => { | |
console.log(`${hello()}${espaco()}${world()}`) | |
console.log(`${helloworld()}`) | |
} | |
(async ()=>{test()})() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const hello = exports.hello = () => { | |
return "Hello" | |
} | |
const espaco = exports.espaco = () => { | |
return " " | |
} | |
const world = exports.world = () => { | |
return "World" | |
} | |
exports.helloworld = () => { | |
return `${hello()}${espaco()}${world()}` | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Saída