why export default not accepting in const
Gobinath Varatharajan
Posted on February 5, 2023
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;
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'
]
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 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.