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
8 changes: 8 additions & 0 deletions 8 Week1/arrays.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
//append arrays
let arraysInside = [];
console.log ('my array will contain some animals');
console.log(arraysInside);
let myFavoriteAnimals = ['eagle ', 'dog ', 'horse '];
console.log(myFavoriteAnimals);
myFavoriteAnimals.push('baby pig');
console.log(myFavoriteAnimals);
85 changes: 85 additions & 0 deletions 85 Week1/checkType.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
//using the 'typeof' and compairing types with if statement
const myName = 'abdullah';
let myAge = 33;
let myHobbies = ['swimming', 'coding', 'taking photographs'];
let iAmFunny = true;
let amIFunny = 'yes';
console.log(myName);
console.log(myAge);
console.log(myHobbies);
console.log(iAmFunny);
console.log(amIFunny);
console.log('types of my variables are: string, number, array, boolean, string \(again\)');
console.log(typeof myName);
console.log(typeof myAge);
console.log(typeof myHobbies);
console.log(typeof iAmFunny);
console.log(typeof amIFunny);


if(typeof myName === typeof myAge){
console.log('SAME TYPE')
} else{
console.log('NOT SAME TYPE')
}

if(typeof myName === typeof myHobbies){
console.log('SAME TYPE')
} else{
console.log('NOT SAME TYPE')
}

if(typeof myName === typeof iAmFunny){
console.log('SAME TYPE')
} else{
console.log('NOT SAME TYPE')
}

if(typeof myName === typeof myAge){
console.log('SAME TYPE')
} else{
console.log('NOT SAME TYPE')
}

if(typeof myName === typeof amIFunny){
console.log('SAME TYPE')
} else{
console.log('NOT SAME TYPE')
}

if(typeof myAge === typeof myHobbies){
console.log('SAME TYPE')
} else{
console.log('NOT SAME TYPE')
}

if(typeof myAge === typeof iAmFunny){
console.log('SAME TYPE')
} else{
console.log('NOT SAME TYPE')
}

if(typeof myAge === typeof amIFunny){
console.log('SAME TYPE')
} else{
console.log('NOT SAME TYPE')
}

if(typeof myHobbies === typeof iAmFunny){
console.log('SAME TYPE')
} else{
console.log('NOT SAME TYPE')
}

if(typeof myHobbies === typeof amIFunny){
console.log('SAME TYPE')
} else{
console.log('NOT SAME TYPE')
}

if(typeof iAmFunny === typeof amIFunny){
console.log('SAME TYPE')
} else{
console.log('NOT SAME TYPE')
}

19 changes: 19 additions & 0 deletions 19 Week1/compairingInfinities.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// store diffrent types of data in one array, and compare the infinitives
let allTypesInsideArray = ['abdullah ', 33 , true];
console.log(allTypesInsideArray);


console.log('2 examples for compairing infinities')
let infinitive1 = 6/0;
let infinitive2 = 10/0;
if(infinitive1 === infinitive2){
console.log(true);
} else{
console.log(false);
}

console.log(infinitive1 == infinitive2);

/*in exercise of infinitives i used == and === both
because in this case i wanted to see each option.
i guess types are same but i just anted to see */
3 changes: 3 additions & 0 deletions 3 Week1/helloInDifLang.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
console.log ('hello world'); //english
console.log ('здравствуйте мира'); //russian
console.log('merhaba dunya'); //turkish
24 changes: 24 additions & 0 deletions 24 Week1/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@

<html>
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Hack Your Future</title>
</head>
<body>
<h1>Hello world!</h1>
<script src="app.js"></script>
<script src="helloInDifLang.js"></script>
<script src="inlineQuote.js"></script>
<script src="varXInteger.js"></script>
<script src="varYString.js"></script>
<script src="numberRounding.js"></script>
<script src="arrays.js"></script>
<script src="stringtLenght.js"></script>
<script src="checkType.js"></script>
<script src="percentageCharacter.js"></script>
<script src="compairingInfinities.js"></script>
</body>
</html>
1 change: 1 addition & 0 deletions 1 Week1/inlineQuote.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
console.log('I\'m awesome');
15 changes: 15 additions & 0 deletions 15 Week1/numberRounding.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
//round and compair numbers
let z = 7.25;
console.log(z);
let a = Math.round(z);
console.log(a);
let numbers = [a, z];
let highNumber=(Math.max(z,a));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice!

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks.

console.log(highNumber);


/* ----this is what i found first---
numbers.sort(function(a, b) { return b - a; });
var highest = numbers[0];
console.log(highest);
*/
16 changes: 16 additions & 0 deletions 16 Week1/percentageCharacter.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// using the '%' character
{let x = 7;
x = x % 3;

console.log(x);


x = 7;
console.log('rest from 22/7 as integer is: '+ 22 % x);

let xy = 74;
console.log('rest from 150/ \'value of xy\' as integer is: ' + 150 % xy);

console.log('rest from \'value of xy\' / \'value of x\' as integer is: '+ xy % x);

}
4 changes: 4 additions & 0 deletions 4 Week1/stringtLenght.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// find length of string
let myString = "this is a test";
console.log(myString);
console.log(myString.length);
7 changes: 7 additions & 0 deletions 7 Week1/varXInteger.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
//giving an integer value to variable x
let x;
console.log("the value of my variable x will be: 775");
console.log(x);
x = 775;
console.log("the value of x will be: 775");
console.log(x);
7 changes: 7 additions & 0 deletions 7 Week1/varYString.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
//giving a string value to variable y
let y = "everything is going well";
console.log("the value of my string will be: everything is going well");
console.log(y);
y = "actually everything is going on the best way";
console.log("the value of my string will be: actually everything is going on the best way");
console.log(y);
2 changes: 1 addition & 1 deletion 2 Week2/MAKEME.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Homework Week 2
## Homework Week 2

```
Topics discussed in class this week:
Expand Down
10 changes: 10 additions & 0 deletions 10 Week3/arrays.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
let favoriteAnimals = ["blowfish", "capricorn", "giraffe"];
favoriteAnimals.push('turtle');
console.log(favoriteAnimals);
favoriteAnimals.splice(1 , 0 , 'meerkat');
console.log('the value of favoriteAnimals will be: ["blowfish", "meerkat", "capricorn", "giraffe", "turtle"]');
console.log(favoriteAnimals);
console.log('The array has a length of: ' + favoriteAnimals.length);
favoriteAnimals.splice(3 , 1 ,);
console.log(favoriteAnimals);
console.log('The item you are looking for is at index: '+favoriteAnimals.indexOf('meerkat'))
40 changes: 40 additions & 0 deletions 40 Week3/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<style>
.welcome{
width: 700px;
height: 500px;
background-color: antiquewhite;
font-family: Helvetica, sans-serif;
text-align: center;
}

</style>
</head>
<body>
<header class="welcome"> <h1>my app</h1></header>
<script src="strings.js"></script>
<script src="arrays.js"></script>
<script src="moreJs-1.js"></script>
<script src="moreJs-2.js"></script>
<script src="moreJs-3.js"></script>
<script src="moreJs-4.js"></script>
<script src="moreJs-5.js"></script>
<script src="moreJs-6.js"></script>
<script src="moreJs-7and8.js"></script>
<script src="moreJs-9.js"></script>
<script src="moreJs-10.js"></script>
<script src="moreJs-11.js"></script>
<script src="moreJs-12.js"></script>
<script src="moreJs-13.js"></script>
<script src="moreJs-14.js"></script>
<script src="moreJs-15.js"></script>
<script src="moreJs-16.js"></script>
<script src="moreJs-17.js"></script>
</body>
</html>
4 changes: 4 additions & 0 deletions 4 Week3/moreJs-1.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
function sum (a,b,c){
return a+b+c ;
}
console.log(sum(5,6,7));
23 changes: 23 additions & 0 deletions 23 Week3/moreJs-10.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*
Use the list of vehicles to write an advertisement.
So that it prints something like:
"Amazing Joe's Garage, we service cars,
motorbikes, caravans and bikes.".
(Hint: use a for loop.)
*/
function advertisement() {
// let vehicles = [' motorbike' , ' caravan', ' bike', ' car'];
// variable 'vehicles' is can be read from moreJs-7and8.js
// but i used it again inside of function to show you,
// and in case you can run in a html seperately.
let products = [];
for (i = 0; i < vehicles.length; i++) {
products.push(' ' + vehicles[i] + 's');
}
let lastTwoProduct = products[products.length - 2] + ' and' + products[products.length - 1];
console.log(lastTwoProduct);
products.splice(products.length - 2, 2);

console.log("Amazing Abdullah's Garage, we sell " + products.join() + ',' + lastTwoProduct + '.');
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fine!

Another way to do this is this:


vehicles = ["car", "bike", "train"];

function advertisement() {
  let fullString = "Amazing Joe's Garage, we service ";
  for (let i = 0; i < vehicles.length; i++) {
    const element = vehicles[i];
    if (i < vehicles.length - 2) {
      fullString += vehicles[i] + ', ';
    } else if (i === vehicles.length - 2) {
      fullString += vehicles[i];
    } else {
      fullString += ' and ' + vehicles[vehicles.length - 1] + "."
    }
  }
  console.log(fullString);
}

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think your example automate better. Thanks. it will be in my codes today before evening

advertisement();
31 changes: 31 additions & 0 deletions 31 Week3/moreJs-11.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
Use the list of vehicles to write an advertisement.
So that it prints something like:
"Amazing Joe's Garage, we service cars,
motorbikes, caravans and bikes.".
(Hint: use a for loop.)

** below moreJs-10.js **

function advertisement(){
let vehicles = [' motorbike' , ' caravan', ' bike', ' car'];
// variable 'vehicles' is can be read from moreJs-7and8.js
// but i used it again inside of function to show you,
// and in case you can run in a html seperately.
let products = [];
for(i=0; i<vehicles.length; i++){
products.push(vehicles[i]+'s');
}
let lastTwoProduct = products[products.length - 2] + ' and ' + products[products.length - 1] ;
console.log(lastTwoProduct);
products.splice(2, 2,);

console.log('Amazing Abdullah\'s Garage, we sell ' + products.join() + ',' + lastTwoProduct +'.');


}
*/

vehicles.push('turck', 'scooter');
advertisement();

1 change: 1 addition & 0 deletions 1 Week3/moreJs-12.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
let objCourse = {};
9 changes: 9 additions & 0 deletions 9 Week3/moreJs-13.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
objCourse = {
teacher1: 'Rob',
teacher2: 'Philip',
teacher3: 'Unmesh',
teacher4: 'Hardit',
teacher5: 'Noer',
teacher6: 'Sander',
};
console.log(objCourse);
2 changes: 2 additions & 0 deletions 2 Week3/moreJs-14.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
objCourse.langs = 'html, CSS, CLI, JavaScript';
console.log(objCourse);
24 changes: 24 additions & 0 deletions 24 Week3/moreJs-15.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
let x = [1, 2, 3];
let y = [1, 2, 3];
let z = y;
// lets see values
console.log(x); // [1, 2, 3]
console.log(y); // [1, 2, 3]
console.log(z); // [1, 2, 3]
// we sow that values of three array are same/ equal
// now try equality and strict equality test
console.log(x==y); //false
console.log(x===y); //false
console.log(x==z); //false
console.log(x===z); //false
console.log(y==z); //true
console.log(y===z); //true
// above, i sow that only y and z equals. well of course x is a different array even the value is same.
// i understood that i did not tested equality of values!! :)

// now i want to see y and z assigns each other
z.push(4);
console.log(y); //[1, 2, 3, 4]

// we can see values of x and z equals
console.log(x[0,1,2]==z[0,1,2]); //true
16 changes: 16 additions & 0 deletions 16 Week3/moreJs-16.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
let o1 = { foo: "bar" };
let o2 = { foo: "bar" };
let o3 = o2;
o1.foo2 = 'pub';
console.log(o3); //o1 doesnt change o3
console.log(o1); // {foo: "bar", foo2: "pub"} o1 only changes itself

o3.foo2 = 'car';
console.log(o2); //{foo: "bar", foo2: "car"} , o3 changes o2

delete o2.foo2;
console.log(o3); //{foo: "bar"} , o2 changes o3

//we understand in the example above that
// order (o3 = o2 or o2 = o3) doesnt matter.

6 changes: 6 additions & 0 deletions 6 Week3/moreJs-17.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
let bar = 42;
typeof typeof bar;

console.log(typeof bar); // number the type of variable 'bar' so pure 42 is 'number'
console.log(typeof typeof bar); // string / 'number' is a word. its text. its string!
// because we ask for type of (type of 'bar) = ' number '
Loading
Morty Proxy This is a proxified and sanitized view of the page, visit original site.