I have a doubt regarding functions(objects) in javascript.
I have 2 pieces of code like,
var a= function(){
console.log('abc')
}
and
var a= (function(){
console.log('abc')
})
what is the difference between these two>>
thanx:)
There is no practical difference. They will both result in an anonymous function being assigned to
a.The first is a "simple assignment". In the second, the parentheses are acting as a "grouping operator", which does one thing:
So the grouping operator will return the function contained within it, and assign it to
a, just like the first example.