Moduł eksportowy w ES6
let func = (a) => a + a
let obj = {}
let x = 0
export {func, obj, x}
Outrageous Ostrich
let func = (a) => a + a
let obj = {}
let x = 0
export {func, obj, x}
//2 ways of module.exports
// 1
function celsiusToFahrenheit(celsius) {
return celsius * (9/5) + 32;
}
module.exports.celsiusToFahrenheit = celsiusToFahrenheit;
//2
module.exports.fahrenheitToCelsius = function(fahrenheit) {
return (fahrenheit - 32) * (5/9);
};