Skip to content
Snippets Groups Projects
Commit 9d20b966 authored by Dorian Barré's avatar Dorian Barré
Browse files

ajout du Td_debug

parent c403d6a3
No related branches found
No related tags found
No related merge requests found
function deb1(): number {
let j = 200;
for (let i = 0; i < 10; i++) {
j -= 10;
}
return j;
}
\ No newline at end of file
function deb1(): number {
let j = 200;
let tab: number[] = [];
for (let i = 0; i < 10; i++) {
j -= 10;
tab.push(j);
}
return j;
}
deb1();
\ No newline at end of file
function changeValue(x: number, y: number): void {
const tmp = y;
y = x;
x = tmp;
console.log(x, y);
}
let x = 10;
let y = 20;
changeValue(x, y);
console.log(x, y);
\ No newline at end of file
function deb3(xy: number[]): void {
let tmp = xy[0];
xy[0] = xy[1];
xy[1] = tmp;
console.log(xy);
}
let xy = [10, 20];
deb3(xy);
console.log(xy);
\ 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;
}
\ No newline at end of file
let tab1 = [1, 2, 3];
let tab2 = tab1;
tab1[1] = 5;
console.log(tab1, tab2);
let tab1 = [1, 2, 3];
let tab2 = [...tab1];
tab1[1] = 5;
console.log(tab1, tab2);
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment