Ajout exercices supplémentaires formation JS
This commit is contained in:
5
javascript/base/exercices/tableaux/index.html
Normal file
5
javascript/base/exercices/tableaux/index.html
Normal file
@ -0,0 +1,5 @@
|
||||
<html>
|
||||
<body>
|
||||
<script src="tableaux.js"></script>
|
||||
</body>
|
||||
</html>
|
17
javascript/base/exercices/tableaux/tableaux.js
Normal file
17
javascript/base/exercices/tableaux/tableaux.js
Normal file
@ -0,0 +1,17 @@
|
||||
|
||||
/*
|
||||
* Énoncé:
|
||||
*
|
||||
* Implémenter via une méthode d'itération d'un tableau une fonction
|
||||
* permettant de récupérer la valeur maximum dans celui ci.
|
||||
*/
|
||||
|
||||
var arr = [15, 20, 15, 16, -1, 4];
|
||||
|
||||
var methodeName = ''/*??*/;
|
||||
|
||||
var max = arr[methodeName](function(/*??*/) {
|
||||
/* ?? */
|
||||
}/*, ?? */);
|
||||
|
||||
console.log(max); // -> 20
|
Reference in New Issue
Block a user