Skip to content

Commit ebcdf6a

Browse files
nullish coalescing
1 parent 2f8b46e commit ebcdf6a

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/app.ts

+7
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,13 @@ const fetchedUserData = {
4040

4141
console.log(fetchedUserData?.job?.title);
4242

43+
const userInput = "";
44+
//const userInput = undefined;
45+
46+
const storedData = userInput ?? "DEFAULT";
47+
48+
console.log(storedData);
49+
4350
const result = add("Dan", "the Man");
4451
result.split(" ");
4552

0 commit comments

Comments
 (0)