Back

Write a function in javascript to print a statement "GUVI Geek Technologies, Chennai" in console and also in alert box.

Created 3 years ago
1922 Views
2 Comments
AnaswaraTJYIKK
@AnaswaraTJYIKK
AnaswaraTJYIKK
@AnaswaraTJYIKKProfile is locked. Login

<!DOCTYPE html>

<html>

<body>

<script>

var first=function(){

console.log( "GUVI Geek Technologies, Chennai");

alert( "GUVI Geek Technologies, Chennai");

};

first();

</script>

</body>

</html>

The code returns error at run time.

>>> /box/main.js:1
(function (exports, require, module, __filename, __dirname) { 
                                                              ^

SyntaxError: Unexpected token <
    at createScript (vm.js:74:10)
    at Object.runInThisContext (vm.js:116:10)
    at Module._compile (module.js:588:28)
    at Object.Module._extensions..js (module.js:635:10)
    at Module.load (module.js:545:32)
    at tryModuleLoad (module.js:508:12)
    at Function.Module._load (module.js:500:3)
    at Function.Module.runMain (module.js:665:10)
    at startup (bootstrap_node.js:201:16)
    at bootstrap_node.js:626:3


Runtime Error (NZEC)
Comments (2)
Please login to comment.