Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tp-git debug
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TIRONI Baptiste
tp-git debug
Commits
593ad2fd
Commit
593ad2fd
authored
1 month ago
by
TIRONI Baptiste
Browse files
Options
Downloads
Patches
Plain Diff
jusqu a 7
parent
006e84e9
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Untitled-1.ts
+38
-0
38 additions, 0 deletions
Untitled-1.ts
with
38 additions
and
0 deletions
Untitled-1.ts
+
38
−
0
View file @
593ad2fd
...
@@ -33,3 +33,41 @@ console.log(xy); // 20 10 (échange de valeur car xy est un tableau et les table
...
@@ -33,3 +33,41 @@ console.log(xy); // 20 10 (échange de valeur car xy est un tableau et les table
let
j
=
10
;
let
j
=
10
;
deb4
();
deb4
();
console
.
log
(
j
);
console
.
log
(
j
);
function
deb4
():
number
{
let
j
=
25
;
for
(
let
i
=
0
;
i
<
10
;
i
++
)
{
let
j
=
2
*
i
;
console
.
log
(
j
);
// 0 2 4 6 8 10 12 14 16 18
}
return
j
;
// 25 car le premier let est local à la fonction deb4 et le second est local à la boucle for
}
/*let tab1 = [1, 2, 3];
let tab2 = tab1;
tab1[1] = 5;
console.log(tab1, tab2); // [1, 5, 3] [1, 5, 3] meme tableau
*/
let
tab1
=
[
1
,
2
,
3
];
let
tab2
=
[
...
tab1
];
tab1
[
1
]
=
5
;
console
.
log
(
tab1
,
tab2
);
// [1, 5, 3] [1, 2, 3] deux tableaux différents
deb7
(
-
5
,
3
);
function
deb7
(
x
:
number
,
y
:
number
)
:
number
{
let
val
=
0
;
for
(
let
i
=
0
;
i
<
y
;
i
++
)
{
val
+=
x
;}
return
val
;
}
/*function deb7(x: number, y: number) : number {
if (y === 0) {
return 0;}
return x * y;
}*/
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment