parent
d0c066fcb9
commit
121b1700da
@ -0,0 +1,12 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>30DaysOfScript:Internal Script</title>
|
||||
</head>
|
||||
<body>
|
||||
<button onclick="alert('Welcome to 30DaysOfJavaScript!');">Click Me</button>
|
||||
<script>
|
||||
console.log('Welcome to 30DaysOfJavaScript')
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,13 @@
|
||||
const array = [];
|
||||
const arraOfNumbers = [1, 2, 3, 4, 5, 6];
|
||||
let lengtharraOfNumbers = arraOfNumbers.length;
|
||||
const firstItem = arraOfNumbers[0];
|
||||
//Get the first item,
|
||||
console.log(firstItem);
|
||||
console.log(lengtharraOfNumbers);
|
||||
//Get the middle item
|
||||
let middleItem = lengtharraOfNumbers / 2;
|
||||
console.log(middleItem);
|
||||
//Get the last item
|
||||
const [lastItem] = arraOfNumbers.slice(-1);
|
||||
console.log(lastItem);
|
Loading…
Reference in new issue