0

everyone , i traydi create a arrow function but its not working in my way

console.log(cevabiKontrolEt("c"); //Ture //resalt

console.log(cevabiKontrolEtme("c"); //False //resalt

what is the different between them

Blockquote

let soru5={
    soruMetni: "hanig soru jaavadan gelir",
    cevapSecenekleri: {
        a: "node.",
        b: "banbası",
        c: "atası"
    },
    dogruCevap: "c",
    cevabiKontrolEt :function(cevap) { return cevap === this.dogruCevap; },
    cevabiKontrolEtme :(cevap) =>   cevap === this.dogruCevap 
    
 
}
console.log(cevabiKontrolEt("c"); //Ture //resalt
console.log(cevabiKontrolEtme("c"); //False //resalt
  • this has been anwered multiple times https://stackoverflow.com/questions/29030747/what-does-arrow-function-mean-in-javascript – vaira Sep 13 '22 at 04:25
  • below code is worked finally :) `let soru5={ soruMetni: "hanig soru jaavadan gelir", cevapSecenekleri: { a: "node.", b: "banbası", c: "atası" }, dogruCevap: "d", cevabiKontrolEt :function(cevap) { return cevap === this.dogruCevap; }, cevabiKontrolEtme : (a) => a == soru5.dogruCevap , buneki:"c", } console.log(soru.soruMetni); console.log(soru5.cevabiKontrolEt("c")); console.log(soru5.soruMetni); console.log(soru5.cevabiKontrolEtme("c")); ` – Hasan Aydeğer Sep 14 '22 at 02:41

0 Answers0