Pergunta de entrevista da empresa ValueLabs

What is the difference between these declarations? function a(){ } var a = function(){ }

Respostas da entrevista

Sigiloso

31 de mai. de 2015

afoucs both are same but var a is aside to a variable but function is directly assigned to dom which will take more memory as it will go into browser default function level(3 party level)

Sigiloso

30 de abr. de 2015

My answer: Both declarations are same. Expected answer: The first declaration takes more memory!