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

Exercice 5 : etude de porté variable

parent 722ae82a
No related branches found
No related tags found
No related merge requests found
...@@ -50,9 +50,22 @@ function deb3(xy: number[]): void { ...@@ -50,9 +50,22 @@ function deb3(xy: number[]): void {
xy = [100, 200]; xy = [100, 200];
} }
let xy = [10, 20]; //let xy = [10, 20];
deb3(xy); //deb3(xy);
console.log(xy); //console.log(xy);
// exo 5 : etude porté de variables
\ No newline at end of file
let j = 10;
deb4();
console.log(j);
function deb4(): number {
let j = 25;
for (let i = 0; i < 10; i++) {
let j = 2 * i;
console.log(j);
}
return j;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment