What's the difference between function A () {} and var A = function A () {}

What"s the difference between

function A () {} and var A = function A () {}.

Mar.05,2021

1.function A () {} is the function declaration
2.var A = function A () {} is an expression, assigning a reference to function A to a variable A
1 has the problem of declaring promotion while 2 will not.


 
function A() {}


var A = function() {};


var A = function A() {};



MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1c29f48-32d0d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1c29f48-32d0d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?