Skip to content

Instantly share code, notes, and snippets.

View ferditarakci's full-sized avatar

Ferdi Tarakcı ferditarakci

View GitHub Profile
echo dateDayFormat("today", "tr") // "2022-10-13"
// Output: 13, 14 ve 15 Ekim 2022
// -----------------------------------------
echo dateDayFormat("2022-12-30", "tr")
// Output: 30, 31 Aralık 2022 ve 1 Ocak 2023
const sayHello = () => "Merhaba";
sayHello();
// output: Merhaba
const sum = (a, b) => {
const c = a * 2;
const d = b * 2;
const result = a + b + c + d;
return result;
// süslü parantez kullandığımızda geri sonuç döndürmek için bir "return"'a ihtiyacımız olacak.
}
sum(3, 5);
// output: 24
const sayHello = name => `Merhaba ${name}`;
sayHello("Ferdi");
// output: Merhaba Ferdi
sayHello("Meryem");
// output: Merhaba Meryem
// ---------------------------
const multiply = function(a, b) {
return a * b;
}
multiply(3, 5);
// output: 15
multiply(2, 40);
// output: 80
const multiply = (a, b) => a * b;
multiply(3, 5);
// output: 15
multiply(2, 40);
// output: 80
// ---------------------------
// Function Declaration
function sayHello(name) {
return `Merhaba, ${name}!`;
}
sayHello("Ferdi");
// output: Merhaba Ferdi
// ---------------------------