Lesson 1
Lesson 1 of 16
JavaScript - Front-End vs Back-End
Lesson Progress: 0%
Code Example
console.log("test");Instructions
▼ ← Click the triangle to hide or reveal instructions.JavaScript Code Editor
Select a Language:
Output
JavaScript Code Editor
Task Incomplete
Editor Input:
Editor Output:
JavaScript can run in two main places: the front end and the back end. The front end is what users see in the browser, while the back end works behind the scenes on a server.
Front-end JavaScript is used for things like:
Browsers have built-in programs called JavaScript engines. These engines read and run JavaScript code.
Back-end JavaScript runs on a server instead of in a browser. It focuses on handling data and processing requests. Back-end JavaScript is used for things like:
Node.js is a program that allows JavaScript to run outside the browser. It made it possible to use JavaScript in servers.
Together, front-end JavaScript and Node.js allow developers to build full websites using one language.
Code Example
<!DOCTYPE html>
<html>
<body>
<h1>My First Web Page</h1>
<p>My First Paragraph</p>
<p id="demo"></p>
<script>
document.getElementById("demo").innerHTML = "<h2>Hello World</h2>";
</script>
</body>
</html>Instructions
▲ ← Click the triangle to hide or reveal instructions.HTML Code Editor
Select a Language:
Output