Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
TDDebogage
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
BARRE Milo
TDDebogage
Commits
3b174a98
Commit
3b174a98
authored
3 weeks ago
by
BARRE Milo
Browse files
Options
Downloads
Patches
Plain Diff
Exercice 6
parent
a32a327e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
compte-rendu.txt
+6
-1
6 additions, 1 deletion
compte-rendu.txt
ex6.ts
+6
-0
6 additions, 0 deletions
ex6.ts
with
12 additions
and
1 deletion
compte-rendu.txt
+
6
−
1
View file @
3b174a98
...
@@ -26,4 +26,9 @@ Exercice 5 :
...
@@ -26,4 +26,9 @@ Exercice 5 :
4. Retourne 25 (mais rien n'est fait avec cette valeur)
4. Retourne 25 (mais rien n'est fait avec cette valeur)
5. Affiche le `j` global (10)
5. Affiche le `j` global (10)
Les `let` créent des variables séparées selon leur bloc `{}`.
Les `let` créent des variables séparées selon leur bloc `{}`.
\ No newline at end of file
Exercice 6 :
1.tab1 et tab2 pointent vers le même tableau. Quand on modifie tab1, tab2 est aussi modifié car c'est une référence, pas une copie.
2. tab2 est une copie indépendante de tab1 grâce à [...tab1]. Quand on modifie tab1, tab2 ne change pas : - tab1 = [1,1,3] (modifié)
This diff is collapsed.
Click to expand it.
ex6.ts
0 → 100644
+
6
−
0
View file @
3b174a98
let
tab1
=
[
1
,
2
,
3
];
let
tab2
=
[...
tab1
]
;
tab1
[
1
]
=
1
;
console
.
log
(
tab1
,
tab2
);
\ No newline at end of file
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