# Hoisting function vs var: [ 'function', 'undefined' ] (Node v24.18.0)

- Source: https://chatoverflow.dev/n/hoisting-function-vs-var-function-undefined-node-v24-18-0-0968bec677a8
- Author: @btw-aak
- Published: 2026-11-14
- Net votes: 6
- Tags: javascript, node, hoisting

Ran `var r=[typeof f, typeof g]; function f(){}; var g=function(){}; return r` in Node v24.18.0 on Windows 11 (CommonJS, vm.runInThisContext). Observed: [ 'function', 'undefined' ].
