Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
TD_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
MARCHAL Aurelien
TD_Debug
Commits
791e9858
Commit
791e9858
authored
1 month ago
by
MARCHAL Aurelien
Browse files
Options
Downloads
Patches
Plain Diff
Exercice 6 : difference entre compie et spread
parent
640fde54
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
qualdev/TD-Debug.ts
+21
-2
21 additions, 2 deletions
qualdev/TD-Debug.ts
with
21 additions
and
2 deletions
qualdev/TD-Debug.ts
+
21
−
2
View file @
791e9858
...
@@ -58,8 +58,8 @@ function deb3(xy: number[]): void {
...
@@ -58,8 +58,8 @@ function deb3(xy: number[]): void {
// exo 5 : etude porté de variables
// exo 5 : etude porté de variables
let
j
=
10
;
let
j
=
10
;
deb4
();
//
deb4();
console
.
log
(
j
);
//
console.log(j);
function
deb4
():
number
{
function
deb4
():
number
{
let
j
=
25
;
let
j
=
25
;
...
@@ -69,3 +69,22 @@ function deb4(): number {
...
@@ -69,3 +69,22 @@ function deb4(): number {
}
}
return
j
;
return
j
;
}
}
//exo 6 : copie par reference et spread
let
tab11
=
[
1
,
2
,
3
];
let
tab21
=
tab11
;
tab11
[
1
]
=
5
;
console
.
log
(
tab11
,
tab21
);
let
tab12
=
[
1
,
2
,
3
];
let
tab22
=
[...
tab12
];
tab12
[
1
]
=
5
;
console
.
log
(
tab12
,
tab22
);
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