Aug 22, 2024
What is JavaScript?
What can you do with JavaScript?
Where does JavaScript code run?
What is the difference between JavaScript and ECMAScript?
console.log('Hello World');
js-basics
.index.html
and add basic HTML boilerplate.index.js
for JavaScript code.index.js
in index.html
:
<script src="index.js"></script>
let name;
(modern best practice)
const
for constants (values that don't change).let name = 'Mosh';
let age = 30;
let isApproved = true;
let person = {
name: 'Mosh',
age: 30
};
person.name
person['name']
let colors = ['red', 'blue'];
colors[0]
.function greet(name) {
console.log('Hello ' + name);
}
greet('Mosh');