Last active
February 25, 2021 21:43
-
-
Save milikkan/19ac4713b9f01dc84eb3cb6344829d35 to your computer and use it in GitHub Desktop.
Array.fill() deneme
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8" /> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
<title>Document</title> | |
</head> | |
<body> | |
<p>Diziyi fill etmek için değer gir:</p> | |
<input type="text" id="userValue" /> | |
<script src="script.js"></script> | |
</body> | |
</html> |
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
const input = document.getElementById("userValue"); | |
const div = document.getElementById("arrayContent"); | |
const myArray = [0, 0, 0, 0, 0, 0]; | |
input.addEventListener("keyup", (e) => { | |
myArray.fill(e.target.value); | |
div.innerHTML = `<pre>${myArray}</pre>`; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment