why export default not accepting in const

gobinath

Gobinath Varatharajan

Posted on February 5, 2023

why export default not accepting in const

Uncovered part to javascript 1

const is a javascript keyword for decalring variable,
const a = 3
you can declare multiple vatiable in const like

const a = 4;
      b = 9;
Enter fullscreen mode Exit fullscreen mode

This work well but when you used export and default javascript does not support export and default together.

If you want to assign export in const you need to do the fellowing.

export const = [
name: 'jim',
work: 'FBI'
]
Enter fullscreen mode Exit fullscreen mode

Bonus: when you writing json last value and array should not end with ,.

If you want to use export and default in javascript means then you should used

function sum(a, b) {
return a + b;
}

javascript throw error when you write the export default in const.

Happy Learning

πŸ’– πŸ’ͺ πŸ™… 🚩
gobinath
Gobinath Varatharajan

Posted on February 5, 2023

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related