Say I had the following array: [x, y, z]
If I wanted to shuffle that array and display each element one by one (without repeating) on each button click, how would I write that function with Javascript to populate the paragraph? Also, would you recommend writing the code inline or on a separate sheet and then imbedding it? Thank you in advance.
<!doctype html>
<html>
<head>
<link rel="stylesheet" href="styles.css">
<title> Title </title>
</head>
<body>
<script src="javascript.js"></script>
<div>
<p></p>
</div>
<div>
<button onclick="displayElement()">Start</button>
</div>
</body>
</html>