JSFiddle - React, Tailwind, and code Playground

by crackingthefrontendinterview

JavaScript

// // trying to access x before the variable declaration
// console.log("x : ", x);

// // trying to access function getName before the variable declaration
// console.log("getName : ", getName);

// // trying to execute function getName before the variable declaration
// console.log("getName() : ", getName());

// var x = 9;

// // function declaration
// function getName() {
//     var a = 1;
// 	console.log("Hello world");
// }

// // function expression
// var getName2 = function () {
// 	console.log("Hello from getname 2");
// };

// // arrow function
// var getName3 = () => {
// 	console.log("Hello from getname 3");
// };

function funcA(m,n) {
    return m * n;
}

function funcB(m,n) {
    return funcA(m,n);
}

function getResult(num1, num2) {
    return funcB(num1, num2)
}

var res = getResult(5,6);

console.log(res); // 30