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
let id = 21; | |
function executor (resolve, reject){ | |
getData(id, resolve) | |
}; | |
const myPromise = new Promise(executor); | |
myPromise | |
.then((result)=>{ |
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
const id = 21; | |
function executor (resolve, reject){ | |
getData(id, resolve) | |
}; | |
function handler(result){ | |
console.log(result) | |
}; |
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
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){ |
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
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) | |
}) |
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
const id = 21; | |
const callback = function(data){ | |
console.log(data) | |
}; | |
getData(id, callback); |
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
{"lastUpload":"2019-11-21T09:57:13.810Z","extensionVersion":"v3.4.3"} |
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
// eski kopyalama yöntemi | |
// const o2 = Object.assign({}, o1); | |
//yeni kopyalama yöntemi | |
const o2 = JSON.parse(JSON.stringify(o1)); |
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
o2.ox.z = 333; //bu daha başlangıç :) |
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
// 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 |
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
// 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