Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
This repository was archived by the owner on May 14, 2024. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
141 changes: 141 additions & 0 deletions 141 app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
//1.
let englishGreeting = "Hello, World!"
console.log(englishGreeting);
let kurdishGreeting = "Silav, Cihan!"
console.log(kurdishGreeting);
let dutchGreeting = "Hoi, Wereld!"
console.log(dutchGreeting);

Shvan1 marked this conversation as resolved.
Show resolved Hide resolved
//2.
let me = "I'm awesome!"
console.log(me);

//3.1
let x;

//3.2
console.log("I think the value of x will be: undefined");

//3.3
console.log(x);

//3.4
let x = 6;

//3.5
console.log("the value of x is: 6");

//3.6
console.log(x);

//4.1
let y ="Sivan";

//4.2
console.log("I think the value of y is a name");

//4.3
console.log(y);

//4.4
const y = "Hassam";

//4.5
console.log("There will be an error because now I have the same variable with different values.");

//4.6
console.log(y);

//5.
const z = 7.25;

//5.1
console.log(z);

//5.2
const a = z;

//5.3
console.log(a);

//5.4
var round =Math.round(7.25);

//5.6
console.log(round)

//6.1
let arrays;

//6.2
console.log("I think the value will be undefined");

//6.3
console.log(arrays);

//6.4
let myFavoriteAnimals = ['cat', 'dog', 'sheep'];

//6.5
console.log(myFavoriteAnimals);

//6.6
const animals = myFavoriteAnimals.push('baby pig');

//6.7
console.log(animals);

//7.1
let myString = "this is a test";

//7.2
console.log(myString);

//7.3
console.log(myString.length);

//8.1
let num = 11;
let address = "Huygenhoekring";
let supermarkets = ["Lidl", "Dekka", "Jumbo"];
let booleans = true, false, true;

//8.2
console.log(num);
console.log(address);
console.log(supermarkets);
console.log(booleans);

//8.3
console.log("I think the type of num is number, type of address is string, type of supermarkets is array and type of booleans is boolean.");

//8.4
console.log(typeof num);
console.log(typeof supermarkets);
console.log(typeof booleans);
console.log(typeof address);

//8.5
if (num != address) {
console.log("num is a number and address is a string");
}

//9.1
let s = 7;
let v = 3;
let h = s % 3;
console.log(s % h);
console.log(s % v);
console.log(v % h);

//10.1
const mix = [5, "Shvan"];
console.log(mix);

//10.2
var maxNumber = Math.pow(6/0);

//10.2
if (maxNumber === Infinity){
console.log(0 / maxNumber);
Shvan1 marked this conversation as resolved.
Show resolved Hide resolved
}
131 changes: 131 additions & 0 deletions 131 week3.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
//String
let myString = "Hello,this,is,a,difficult-,to-,read,sentence";
console.log(myString);
console.log(myString.length);
myString = myString.replace(/,/g, " ");
console.log(myString);

//Arrays
let favoriteAnimals = ["blowfish", "capricorn", "giraffe"];
console.log(favoriteAnimals);

let favoriteAnimalsOfMauro = ["blowfish", "capricorn", "giraffe", "turtle"];
console.log(favoriteAnimalsOfMauro);

let favoriteAnimalsOfJim = ["blowfish", "meerkat", "capricorn", "giraffe", "turtle"];
console.log("The favorite animal of Jim is added to the array.");
console.log(favoriteAnimalsOfJim);
console.log("The array has a length of:", favoriteAnimalsOfJim.length);

let favoriteAnimalsOfJason = ["blowfish", "meerkat", "capricorn", "turtle"];
console.log(favoriteAnimalsOfJason);
console.log(favoriteAnimalsOfJason.length);
console.log(favoriteAnimalsOfJason[1], "The item you are looking for is at index:2");

//JavaScript
function sum(a, b, c) {
return a + b + c;
}
console.log(sum(5, 3, 2));
//2.
function colorCar(color){
return "A" + color + "car";
}
console.log(colorCar("red"));
//3.
let country = {Land: "The Netherlands", Population:"17 million", Capital:"Amsterdam"};
console.log(country);
console.log(country.Land);
console.log(country.Population);
//4.
function vehicleType(color, code){
if (code === 1){
console.log("A" + color + "car");
} else if (code === 2){
console.log("A" + color + "motorbike");}
}
vehicleType("blue", 2);
//5.
3===3 ? console.log("Yes") : console.log("No");
//6
function vehicle(color, code, age){
if (code === 1 || age > 5){
console.log("A" + "" + color + "" + "used car");
} else if (code === 2 || age < 5){
console.log("A" + "" + color + "" + "new car");
}
}
vehicle("blue", 1, 5);
//7.
const vehicleList = [
"motorbike",
"caravan",
"bike",
"bicycle",
"car"
];
console.log(vehicleList.length);
console.log(vehicleList[2]);

//9
function newVehicle(color){
if (vehicleList[2] = 3){
console.log("A" + "" + color + "" + "new" + "" + "bike");
} else (vehicleList[2] > 3);{
console.log("A" + "" + color + "" + "old" + "" + "bike")
}
}
newVehicle("green", 3, 1);

//10
const advertisement = vehicleList;
console.log(advertisement);
for (let index = 0; index < advertisement; index++) {
console.log(advertisement[index]);
}
if (advertisement.length = 5) {
console.log("Amazing Joe's Garage >>> Here we service cars, motorbikes, caravans and bikes.");
}else {
console.log("Amazing Joe's Garage >>> Here we service bulldozers, lorries and trucks.");
}
//11
const newVehicleList = advertisement + "" + "scooter";
console.log(newVehicleList);
//12.
let object;
//13+14
let teachers = {Philip: "HTML/CSS", Rob: "HTML/CSS", Hardit: "CLI", Bonan: "CLI", Ogor: "CLI", Unmesh: "GIT", Marciano: "JS", Sander: "JS"};

//15
let x = [1, 2, 3];
let y = [1, 2, 3];
let z = y;
console.log(x == y);
console.log(x === y);

console.log(x == z);
console.log(x === z);

console.log(y == z);
console.log(y === z);

//16.
let o1 = { foo: "bar" };
let o2 = { foo: "bar" };
let o3 = o2;
console.log(o1);
console.log(o2);
console.log(o3);
//Do you mean to make new ones?
let o1New = {quur: "quuur"};
let o2New = {quur: "quuur"};
let o3New = o2New;
console.log(o1New);

//17.
let bar = 42;
typeof typeof bar;
console.log(typeof bar); //->> number.
console.log(typeof typeof bar); //->> string.

//the end.
Morty Proxy This is a proxified and sanitized view of the page, visit original site.