Skip to content

Commit 2f8b46e

Browse files
optional chaining
1 parent 1bb52f1 commit 2f8b46e

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/app.ts

+8
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,14 @@ function add(a: Combinable, b: Combinable) {
3232
return a + b;
3333
}
3434

35+
const fetchedUserData = {
36+
id: "u1",
37+
name: "Max",
38+
job: { title: "CEO", description: "Private Company" },
39+
};
40+
41+
console.log(fetchedUserData?.job?.title);
42+
3543
const result = add("Dan", "the Man");
3644
result.split(" ");
3745

0 commit comments

Comments
 (0)