Skip to content

Commit a9711df

Browse files
committed
Add comments explaining switch block
1 parent 54946db commit a9711df

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

page/javascript-101/conditional-code.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,12 +115,13 @@ var stuffToDo = {
115115
116116
};
117117
118+
// Check if the property exists in the object.
118119
if ( stuffToDo[ foo ] ) {
119-
120+
// This code won't run.
120121
stuffToDo[ foo ]();
121122
122123
} else {
123-
124+
// This code will run.
124125
stuffToDo[ "default" ]();
125126
126127
}

0 commit comments

Comments
 (0)