Skip to content
Snippets Groups Projects
Commit fa254e76 authored by MARCHAL Aurelien's avatar MARCHAL Aurelien
Browse files

Exercice 3 : echange valeur qui ne marche pas, rennomage de la fonction

parent 7b1a1874
No related branches found
No related tags found
No related merge requests found
......@@ -13,7 +13,7 @@ function deb1() {
//exo 2 : point d'arret pour un tableau
function deb2() {
function deb1_1() {
let j = 0;
let tab = [];
for (let i = 0; i < 5; i++) {
......@@ -22,5 +22,19 @@ function deb1() {
}
console.log(tab);
}
deb2();
\ No newline at end of file
//deb1_1();
//exo 3 : Point d'arret
function echangeParValeurRater(x : number, y : number): void {
const tmp = y;
y = x;
x = tmp;
console.log(x, y);
}
let x = 10;
let y = 20;
echangeParValeurRater(x, y);
console.log(x, y);
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment