Introduction
What is JavaScript ?
JavaScript is a dynamic programming language, a scripting language used to develop web applications, games, and more. It allows us to implement dynamic features on web pages that cannot do with just HTML and CSS. Javascript are supported by all browsers.
Brendan Eich invented JavaScript in 1995.
Where does JavaScript runs ?
JavaScript mainly runs in web browsers that have built-in engines to interpret and execute JavaScript code. JavaScript isn't just for web browsers, it also runs in node js, It provides a runtime environment that allows JavaScript to run.
JavaScrip Engines with different browsers
1.Chrome uses V8 JavaScript engine and it is known for the speed and efficiency
2.Safari: Safari utilizes the JavaScriptCore engine, developed by Apple.
3.Mozilla Firefox: Firefox employs the SpiderMonkey JavaScript engine, developed by the Mozilla Foundation.
4.Microsoft Edge: Edge used the Chakra JavaScript engine, but with its transition to the Chromium-based engine, it now also relies on the V8 engine
What is Console ?
Console is global object which has different method log
, warn
, error
these methods commonly used for logging information, debugging, and outputting messages to the console.
console.log
, console.warn
, console.error
.
1. console.log()
console.log() is a built-in JavaScript function used to display messages, variables, or other information in the browser's console. It's commonly used for debugging and providing insights into the behavior of JavaScript code.
Code: <!DOCTYPE html>
<html lang="en">
<head>
<title>Javascript</title>
</head>
<body>
<script>
console.log('Hw Welcome to apana iit');
</script>
</body>
</html>