View promise-example-two.js
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 id = 21; | |
function executor (resolve, reject){ | |
getData(id, resolve) | |
}; | |
const myPromise = new Promise(executor); | |
myPromise | |
.then((result)=>{ |
View promise-example-one.js
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
const id = 21; | |
function executor (resolve, reject){ | |
getData(id, resolve) | |
}; | |
function handler(result){ | |
console.log(result) | |
}; |
View pyramid-of-doom-two.js
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
const id = 21; | |
const callback = function(data1){ | |
//1. callback fonksiyon gövdesi | |
console.log(data) | |
//asenkron kod | |
getData(22, function(data2){ | |
//2. callback fonksiyon gövdesi | |
console.log(data,data2) | |
getData(23, function(data3){ |
View pyramid-of-doom.js
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
const id = 21; | |
const callback = function(data1){ | |
//1. callback fonksiyon gövdesi | |
console.log(data) | |
//asenkron kod | |
getData(22, function(data2){ | |
//2. callback fonksiyon gövdesi | |
console.log(data,data2) | |
}) |
View callback-example.js
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
const id = 21; | |
const callback = function(data){ | |
console.log(data) | |
}; | |
getData(id, callback); |
View cloudSettings
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
{"lastUpload":"2019-11-21T09:57:13.810Z","extensionVersion":"v3.4.3"} |
View js_oop_1_3.js
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
// eski kopyalama yöntemi | |
// const o2 = Object.assign({}, o1); | |
//yeni kopyalama yöntemi | |
const o2 = JSON.parse(JSON.stringify(o1)); |
View js_oop_1_2_1.js
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
o2.ox.z = 333; //bu daha başlangıç :) |
View js_oop_1_2.js
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 Literal ile nesne içinde nesne (nested objects) | |
const o1 = { | |
w: 'lorem ipsum', | |
x: 42, | |
y: 3.14, | |
g: function () { }, | |
h: function () { }, | |
// inner object |
View js_oop_1_1.js
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
// o1 nesnesini object literal olarak tanımla | |
const o1 = { | |
w: 'lorem ipsum', | |
x: 42, | |
y: 3.14, | |
g: function () { }, | |
h: function () { } | |
}; | |
// o1 nesnesini kopyalayıp o2 nesnesi oluştur |
NewerOlder