Merge branch 'exercise-solutions' of https://github.com/Dzykas/30-Days-Of-JavaScript into exercise-solutions

pull/862/head
Dzykas 3 years ago
commit ef394e083f

@ -13,14 +13,22 @@
<script src="main.js"></script>
<script src="level2.js"></script>
<<<<<<< HEAD
=======
</body>
>>>>>>> 8d7537174874adc1103af7dd252396640bd70c73
<style>
button{
color: white;
background-color: black;
padding: 5px;
margin: 5px;
<<<<<<< HEAD
border-radius: 6px;
=======
border-radius: 7px;
>>>>>>> 8d7537174874adc1103af7dd252396640bd70c73
}
</style>
<button onclick="triangleA()">Area of a triangle</button><br>
@ -35,5 +43,8 @@
<button onclick="canDrive()">Are you allowed to drive ?</button><br>
<button onclick="lifeLength()">How many seconds have you lived ?</button><br>
<button onclick="calendar()">What's the time?</button><br>
<<<<<<< HEAD
</body>
=======
>>>>>>> 8d7537174874adc1103af7dd252396640bd70c73
</html>

@ -94,5 +94,9 @@ const month = now.getMonth() + 1;
const date = now.getDate();
const hours = now.getHours();
const minutes = now.getMinutes();
<<<<<<< HEAD
alert(`${currentYear}-${month}-${day} ${hours}:${minutes}`);
=======
alert(`${currentYear}-${month}-${day} ${hours}:${minutes}`)
>>>>>>> 8d7537174874adc1103af7dd252396640bd70c73
}

@ -1,3 +1,4 @@
<<<<<<< HEAD
let firstName = "Eligijus";
let lastName = "Dzikavicius";
let country = "Lithuania";
@ -47,3 +48,54 @@ console.log(`The current date is ${date}`);
console.log(`The current day of the week is ${day}`);
console.log(`The current time is ${hours}:${minutes}:${seconds}`);
console.log(`The amount of seconds passed since Jan 1, 1970 is ${allTime}`);
=======
let firstName = "Eligijus"
let lastName = "Dzikavicius"
let country = "Lithuania"
let city = "Kupiskis"
let age = "17"
let isMarried = false
let year = "2023"
console.log(parseInt("10"))
console.log(parseInt("9.8"))
let truthy1 = 12 // truthy
let truthy2 = "string" // truthy
let truthy3 = true // truthy
let falsy1 = 0 // falsy
let falsy2 = "" // falsy
let falsy3 = null // falsy
console.log(4 > 3) // true
console.log(4 >= 3) // true
console.log(4 < 3) // false
console.log(4 <= 3) // false
console.log(4 == 4) // true
console.log(4 === 4) // true
console.log(4 != 4) // false
console.log(4 !== 4) // false
console.log(4 != '4') // false
console.log(4 == '4') // true
console.log(4 === '4') // false
console.log("python".length != "jargon".length) // false
// All correct !
const now = new Date()
const currentYear = now.getFullYear()
const month = now.getMonth() + 1
const date = now.getDate()
const day = now.getDay() + 1
const hours = now.getHours()
const minutes = now.getMinutes()
const seconds = now.getSeconds()
const allTime = now.getTime()
console.log(`The current year is ${currentYear}`)
console.log(`The current month is ${month}`)
console.log(`The current date is ${date}`)
console.log(`The current day of the week is ${day}`)
console.log(`The current time is ${hours}:${minutes}:${seconds}`)
console.log(`The amount of seconds passed since Jan 1, 1970 is ${allTime}`)
>>>>>>> 8d7537174874adc1103af7dd252396640bd70c73

Loading…
Cancel
Save