This file contains hidden or 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
function nextInLine(arr, item) { | |
return item; | |
} | |
let testArr = [1, 2, 3, 4, 5]; | |
console.log("Before: " + JSON.stringify(testArr)); | |
// Before: [1,2,3,4,5] | |
console.log(nextInLine(testArr, 6)); | |
// 6 |
This file contains hidden or 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
function nextInLine(arr, item) { | |
//Argüman olarak verilecek olan "item"ı, yani sayıyı array'in sonuna ekliyoruz | |
arr.push(item); | |
//array'in ilk elemanını siliyoruz ve silinen elemanı döndürüyoruz | |
return arr.shift(); | |
} | |
//testArr adında bir dizi oluşturuyoruz |
This file contains hidden or 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
function welcomeToBooleans() { | |
// Only change code below this line | |
return false; // Change this line | |
// Only change code above this line | |
} |
This file contains hidden or 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
function welcomeToBooleans() { | |
return true; // Döndürülen değeri "true" olarak değiştirdik. | |
} |
This file contains hidden or 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
function test (myCondition) { | |
if (myCondition) { | |
return "It was true"; | |
} | |
return "It was false"; | |
} | |
test(true); | |
test(false); |
This file contains hidden or 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
function trueOrFalse(wasThatTrue) { | |
//eğer koşul sağlanıyorsa | |
if (wasThatTrue) { | |
return "Yes, that was true"; | |
} | |
//eğer koşul sağlanmıyorsa | |
return "No, that was false"; | |
} |
This file contains hidden or 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
function equalityTest(myVal) { | |
if (myVal == 10) { | |
return "Equal"; | |
} | |
return "Not Equal"; | |
} |
This file contains hidden or 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
1 == 1 // true | |
1 == 2 // false | |
1 == '1' // true | |
"3" == 3 // true |
This file contains hidden or 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
function testEqual(val) { | |
if (val == 12) { | |
return "Equal"; | |
} | |
return "Not Equal"; | |
} | |
console.log(testEqual(12)); | |
//Equal |
This file contains hidden or 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
3 === 3 // true | |
3 === '3' // false çünkü '3' bir string değeri |
OlderNewer