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
function createCounter() { | |
let count = 0; // Bu değişken dışarıdan erişilemez. | |
return function() { | |
count++; // İç fonksiyon dıştaki 'count' değişkenine erişebilir. | |
return count; | |
}; | |
} | |
const counter = createCounter(); |
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
var globalVar = "ben global scope"; // Global scope | |
function outerFunction() { | |
var outerVar = "ben outer function scope"; // Outer function scope | |
function innerFunction() { | |
var innerVar = "ben inner function scope"; // Inner function scope | |
console.log(globalVar); // Erişilebilir | |
console.log(outerVar); // Erişilebilir |
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
// ES5 | |
var person = { name: 'Beyza', age: 24 }; | |
var name = person.name; | |
var age = person.age; | |
// ES6 | |
const person = { name: 'Beyza', age: 24 }; | |
const { name, age } = person; |
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
// ES5 | |
var add = function(a, b) { | |
return a + b; | |
}; | |
// ES6 | |
const add = (a, b) => a + b; |
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
// ES5 | |
var x = 10; | |
if (true) { | |
var x = 20; | |
} | |
console.log(x); // 20 | |
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
import { Button } from 'reactstrap'; | |
<Button color="primary">Tıkla</Button> |
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
import { Button } from '@chakra-ui/react'; | |
<Button colorScheme="blue">Tıkla</Button> |
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
import Button from '@material-ui/core/Button'; | |
<Button variant="contained" color="primary"> | |
Tıkla | |
</Button> |
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
<button className="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded"> | |
Tıkla | |
</button> |
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
$primary-color: blue; | |
.button { | |
background-color: $primary-color; | |
&:hover { | |
background-color: darken($primary-color, 10%); | |
} | |
} |
NewerOlder