Can someone please explain why this works in typescript while exporting an object:
export const config={
port:4000
};
This also works:
const config = { port:4000 };
export { config };
But this gives an error
const config={
port:4000
};
export config;
Error : declaration or statement expected.
exportis about the same as javascript export which is a newer, better language feature, designed to replace nodeexportsbut somewhat incompatible with it.