complete Day 1 of JS

pull/178/head
matt vile 4 years ago
parent 07143be3b7
commit 4dbd70aca4

@ -0,0 +1,16 @@
let firstName = 'Matthew'
let yourName = "ODB"
let yourAge = 100
let myAge = 21
const PI = 3.14
let isMarried = true
let nullValue = null
let notDefined
let anotherOne
let andAnotherOne
let undefinedVarFour
array = [firstName, myAge, PI, isMarried, nullValue, notDefined]
array.forEach(logType)
function logType(variable){console.log(typeof variable)}
console.log(`${firstName} is ${myAge} years old`)
console.log(`${yourName} is ${yourAge} years old, what an oldie!`)

@ -11,9 +11,10 @@
<button onclick="alert('Welcome to 30DaysOfJavaScript!');">Click Me</button>
<script src="./helloworld.js"></script>
<script src="./introduction.js"></script>
<script src="./varaible.js"></script>
<script type="module" src="./varaible.js"></script>
<script src="./main.js"></script>
<script type="module" src="./datatypes.js"></script>
</body>
</html>
</html>

@ -1 +1,8 @@
console.log('Welcome to 30DaysOfJavaScript')
// comments can make code readable
console.log('Welcome to 30DaysOfJavaScript')
// display Welcome to 30DaysOfJavaScript
/* comments can make code readable
easy to reuse
and informative
this is a multiline comment
*/

@ -1,11 +1,13 @@
// Declaring different variables of different data types
let firstName = 'Asabeneh' // first name of a person
let lastName = 'Yetayeh' // last name of a person
let country = 'Finland' // country
let city = 'Helsinki' // capital city
let age = 100 // age in years
let isMarried = true
const variablesList = () => {
let firstName = 'Asabeneh' // first name of a person string
let lastName = 'Yetayeh' // last name of a person string
let country = 'Finland' // country string
let city = 'Helsinki' // capital city string
let age = 100 // age in years number
let isMarried = true // boolean value
let nullValue = null // null value
let notDefined // returns not defined
// Declaring variables with number values
@ -18,3 +20,5 @@ const PI = 3.14 // geometrical constant
let name = 'Asabeneh', //name of a person
job = 'teacher',
live = 'Finland'
}
export { variablesList };

Loading…
Cancel
Save