-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 110e749
Showing
19 changed files
with
285 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
let kisiler = ["Osman", "Ertuş" , "Kadir", "Hatice" , "Nazım", "Namık" , "Kemal" , "Sülo"]; | ||
|
||
console.log(kisiler[0]); | ||
console.log(kisiler.length - 1); | ||
console.log(kisiler[7]); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
const sayHello = (name) => console.log("Hello, " + name); | ||
sayHello("Osman"); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
class Country{ | ||
constructor(name, year){ | ||
this.name=name; | ||
this.year=year; | ||
} | ||
|
||
kutla(){ | ||
console.log(`${this.name}'mizin ${this.year}. yılı kutlu olsun!!`); | ||
|
||
|
||
}} | ||
|
||
const bilgi = new Country("Türkiye",101); | ||
|
||
bilgi.kutla(); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
console.log("Dizi Destructuring:"); | ||
|
||
const numbers = [1, 2, 3]; const [first, second, third] = numbers; console.log(first, second, third); | ||
|
||
console.log("Obje Destructuring:"); | ||
|
||
const car = { | ||
model:"1980", | ||
marka:"BMW" | ||
}; | ||
|
||
const{model,marka} = car; | ||
console.log(model,marka); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
for (let i = 0; i < 10; i++){ | ||
console.log("Sayının karesi: " + (i**2)); | ||
|
||
|
||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
function toplama(say1,say2){ | ||
console.log("Belirtilen iki sayının toplamı: " + (say1 + say2)); | ||
|
||
} | ||
|
||
toplama(3,7); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
|
||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>Benim Web Sayfam</title> | ||
</head> | ||
<body> | ||
|
||
<script src="whileKullanim.js"></script> | ||
</html> | ||
|
||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
var kilo = prompt("Lütfen kilonuzu giriniz:"); | ||
var boy = prompt("Lütfen boyunuzu giriniz:"); | ||
|
||
var boyIndex = boy*boy; | ||
var kitleIndex = kilo/boyIndex; | ||
|
||
if(kitleIndex >=45.0){ | ||
window.alert("Aşırı Obezsiniz... Kitle İndexiniz: " + kitleIndex); | ||
} | ||
|
||
else if (kitleIndex >= 30.0 && kitleIndex <= 44.9) { | ||
window.alert("Obezsiniz... Kitle İndexiniz: " + kitleIndex); | ||
} | ||
|
||
else if (kitleIndex >= 25.0 && kitleIndex <= 29.9) { | ||
window.alert("Fazla kilolusunuz... Kitle İndexiniz: " + kitleIndex); | ||
} | ||
|
||
else if (kitleIndex >= 18.5 && kitleIndex <= 24.9) { | ||
window.alert( | ||
"Normal kilodasınız, gayet sağlıklısınız :) Kitle İndexiniz: " + kitleIndex | ||
); | ||
} | ||
|
||
else if (kitleIndex >= 8.5 && kitleIndex <= 18.4) { | ||
window.alert("Zayıfsınız... Kitle İndexiniz: " + kitleIndex); | ||
} | ||
|
||
else if (kitleIndex <= 8.4) { | ||
window.alert("Aşırı Zayıfsınız... Kitle İndexiniz: " + kitleIndex); | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
let a = 134; | ||
console.log(a); | ||
const b = 123; | ||
b++; //Hata verdi | ||
console.log(b); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
for(let carpilan = 0; carpilan <= 10; carpilan++){ | ||
for(let carpan = 0; carpan <= 10; carpan++){ | ||
let carpim = carpan*carpilan | ||
console.log(carpilan + " * " + carpan + " = " + carpim); | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
let game = { | ||
name: "Minecraft", | ||
popularity: "2 Billion Downloads", | ||
startDate: 2009, | ||
weSay:function(){ | ||
console.log("Best game is: " + this.name); | ||
} | ||
}; | ||
|
||
console.log(game.name); | ||
console.log(game.popularity); | ||
console.log(game.startDate); | ||
game.weSay(); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
var yeniSatır = "\r\n"; | ||
|
||
var secim = parseFloat( | ||
prompt( | ||
"Hangi benzinden dolduracaksınız?" +yeniSatır+ | ||
"1- Dizel: Litresi 24.53 TL" +yeniSatır+ | ||
"2- Benzin: Litresi 22.25 TL" +yeniSatır+ | ||
"3- LPG: Litresi 11.1 TL" | ||
) | ||
); | ||
|
||
|
||
|
||
var litre = prompt("Kaç litre (L) alacaksınız?"); | ||
var tutar = 0; | ||
|
||
if (secim == 1) { | ||
tutar = 24.53 * litre; | ||
|
||
window.alert("Tutarnız: " + tutar); | ||
} else if (secim == 2) { | ||
tutar = 22.25 * litre; | ||
|
||
window.alert("Tutarnız: " + tutar); | ||
} else if (secim == 3) { | ||
tutar = 11.1 * litre; | ||
|
||
window.alert("Tutarnız: " + tutar); | ||
} else { | ||
window.alert("Geçerli bir değer giriniz!"); | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
function sum(...numbers) { | ||
return numbers.reduce((carpilan,carpim) => carpilan + carpim, -6); | ||
} | ||
console.log(sum(1,2,3)); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
const dizi1 = ['a','b','c','d']; | ||
const dizi2 = ['e','f','g','h']; | ||
const dizi1and2 = [...dizi1,...dizi2]; | ||
console.log(dizi1and2); | ||
|
||
const nesne1 = {icerik1:12, icerik2:34}; | ||
const nesne2 = {icerik3:56, icerik4:78}; | ||
const nesne1and2 = {...nesne1,...nesne2} | ||
console.log(nesne1and2); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
|
||
deger = Number(prompt("1, 2 veya 3 değerlerinden birini giriniz: ")); | ||
|
||
|
||
switch (deger) { | ||
case 1: | ||
alert("1 seçeneğini seçtiniz!"); | ||
break; | ||
case 2: | ||
alert("2 seçeneğini seçtiniz!"); | ||
break; | ||
case 3: | ||
alert("3 seçeneğini seçtiniz!"); | ||
break; | ||
default: | ||
alert("Geçerli bir değer giriniz!"); | ||
|
||
|
||
} | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
const sayHello = (name) => console.log(`Hello, ${name}`); | ||
sayHello("Osman"); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
debugger; | ||
|
||
let a = 10; | ||
let b = 20; | ||
|
||
console.log(typeof a); | ||
console.log(typeof b); | ||
console.log(a.toString() + b.toString()); | ||
|
||
let c = String(20); | ||
let d = String(30); | ||
console.log(c + d); | ||
|
||
console.log(parseInt(a) + parseInt(b) + parseInt(c) + parseInt(d)); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
var turkDogru, | ||
turkYanlis, | ||
turkBos, | ||
turkNet, | ||
dogruDegerTurk, | ||
yanlisDegerTurk, | ||
sonHesapTurk, | ||
turkGercekYanlis; | ||
var matDogru, | ||
matYanlis, | ||
matBos, | ||
matNet, | ||
dogruDegerMat, | ||
yanlisDegerMat, | ||
sonHesapMat; | ||
var sosDogru, | ||
sosYanlis, | ||
sosBos, | ||
sosNet, | ||
dogruDegerSos, | ||
yanlisDegerSos, | ||
sonHesapSos; | ||
var fenDogru, | ||
fenYanlis, | ||
fenBos, | ||
fenNet, | ||
dogruDegerFen, | ||
yanlisDegerFen, | ||
sonHesapFen; | ||
|
||
var turkToplamS = 40, | ||
matToplamS = 40, | ||
sosToplamS = 20, | ||
fenToplamS = 20; | ||
|
||
function getNet(dersAdi, toplamSoru) { | ||
let dogru, yanlis, bos; | ||
do { | ||
dogru = parseInt(prompt(dersAdi + "den kaç doğrunuz var?")); | ||
yanlis = parseInt(prompt(dersAdi + "den kaç yanlışınız var?")); | ||
bos = parseInt(prompt(dersAdi + "den kaç boşunuz var?")); | ||
let net = dogru - yanlis / 4; | ||
if (net > toplamSoru || net < 0) { | ||
alert(dersAdi + " için yanlış değer girdiniz! Lütfen tekrar deneyin."); | ||
} else { | ||
return net; | ||
} | ||
} while (true); | ||
} | ||
|
||
// Türkçe | ||
sonHesapTurk = getNet("Türkçe", turkToplamS); | ||
alert("Türkçe netiniz: " + sonHesapTurk); | ||
|
||
// Matematik | ||
sonHesapMat = getNet("Matematik", matToplamS); | ||
alert("Matematik netiniz: " + sonHesapMat); | ||
|
||
// Sosyal | ||
sonHesapSos = getNet("Sosyal Bilgiler", sosToplamS); | ||
alert("Sosyal Bilgiler netiniz: " + sonHesapSos); | ||
|
||
// Fen | ||
sonHesapFen = getNet("Fen Bilimleri", fenToplamS); | ||
alert("Fen Bilimleri netiniz: " + sonHesapFen); | ||
|
||
// Toplam Net | ||
var toplamNet = sonHesapTurk + sonHesapMat + sonHesapSos + sonHesapFen; | ||
alert("Toplam netiniz: " + toplamNet); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
|
||
let sum = 0; | ||
let rety = 1; | ||
|
||
while(rety <= 10){ | ||
sum = sum + rety; | ||
rety++; | ||
}; | ||
console.log("10 a kadar olan sayıların toplamı: " + sum); | ||
|
||
let sayac = 1; | ||
|
||
while(sayac <= 10){ | ||
|
||
console.log(sayac); | ||
|
||
if(sayac == 8){ | ||
break; | ||
} | ||
|
||
|
||
sayac++ | ||
} |