Last active
July 7, 2019 12:57
-
-
Save meftunca/c9f546c7d4281387068f11d70d052e8c to your computer and use it in GitHub Desktop.
js Class
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
class Basic {} // Basic Sınıfını oluşturalı... | |
const basicClass = new Basic();//Basic Sınıfını çağıralım... |
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
class Basic { | |
factorial(value) { | |
let fac = 1; | |
for (let i = 1; i <= value; i++) fac = fac * i; | |
return fac; | |
} | |
} | |
let basicClass = new Basic(); | |
let fac = basicClass.factorial(5); //factorial methodunu çağırdık ve 5 parametresini verdik | |
//Şimdide console.log ile konsoldan çıktı alalım | |
console.log(fac) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment