This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Object refers to a data structure containing data and/or instructions (functions). | |
// Object Lateral: key-value pairs | |
let dictionary = { | |
'hello': "مرحباً", | |
'good morning': "صباح الخير", | |
translateWord(english_word) { | |
let word = english_word.toLowerCase() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// useful link: https://www.w3schools.com/js/js_datatypes.asp | |
typeof "Hello" // string | |
typeof 'a' // string | |
typeof 7 // number | |
typeof 3.141 // number | |
typeof true // boolean | |
typeof undefined // undefined | |
typeof {name: "Ahmad", age: 99} // object | |
typeof console // object | |
typeof console.log // function |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let hybrid = [1, 2, 3, "hello", "abc", 4, 5, 6] | |
console.log(hybrid.length) | |
let fruits = ["Strawberry", "Apple", "Mango", "Banana"] | |
console.log( fruits.sort()) | |
console.log( fruits[0]) | |
console.log( fruits[fruits.length - 1]) | |
let str = fruits[0] | |
console.log(str.charAt(0) === str[0]) // array-like (but not really array) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>Tab Title</title> | |
<link rel="stylesheet" href="main.css"> | |
<link rel="stylesheet" href="styles.css"> | |
</head> | |
<body> |
NewerOlder