diff --git a/javascript/Day30/index.js b/javascript/Day30/index.js index adbc577..932f3ca 100644 --- a/javascript/Day30/index.js +++ b/javascript/Day30/index.js @@ -35,7 +35,7 @@ function printTable(value) { } let x = 2; - +var y = 3; printTable(x); printTable(y); printTable(4); diff --git a/javascript/Day31/index.js b/javascript/Day31/index.js new file mode 100644 index 0000000..a3d4418 --- /dev/null +++ b/javascript/Day31/index.js @@ -0,0 +1,38 @@ +var result = 6; + +function sum() { + console.log(result); + var two = 2; + var result = two + two; + return result; +} + +sum(); +//undefined + +console.log(window.y); +y = 20; + +console.log(window.y); + +function abc() { + x = 20; + var h = 30; + console.log(x, h); +} + +abc(); + +console.log(window.x); +console.log(h); + +var xyz = function (name) { + console.log("Regular Function " + name); +}; + +const arrow_function = (name) => { + console.log("Arrow Function " + name); +}; + +arrow_function("Ahemad"); +xyz("utkarsh");