Skip to content

Commit 292b7e9

Browse files
authored
fix(curriculum): add optional chaining (freeCodeCamp#59534)
1 parent e89a9b9 commit 292b7e9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Diff for: curriculum/challenges/english/25-front-end-development/workshop-storytelling-app/671fafbae959c048d82bac8d.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ function rgbToHex(rgb) {
2323
return (
2424
"#" +
2525
rgbValues
26-
.map((num) => parseInt(num).toString(16).padStart(2, "0"))
26+
?.map((num) => parseInt(num).toString(16).padStart(2, "0"))
2727
.join("")
2828
);
2929
}
@@ -46,7 +46,7 @@ function rgbToHex(rgb) {
4646
return (
4747
"#" +
4848
rgbValues
49-
.map((num) => parseInt(num).toString(16).padStart(2, "0"))
49+
?.map((num) => parseInt(num).toString(16).padStart(2, "0"))
5050
.join("")
5151
);
5252
}
@@ -69,7 +69,7 @@ function rgbToHex(rgb) {
6969
return (
7070
"#" +
7171
rgbValues
72-
.map((num) => parseInt(num).toString(16).padStart(2, "0"))
72+
?.map((num) => parseInt(num).toString(16).padStart(2, "0"))
7373
.join("")
7474
);
7575
}

0 commit comments

Comments
 (0)