Empty on Purpose
Empty on Purpose
null means a developer deliberately put "nothing" into a variable. undefined means a variable exists but has not been given a value yet.
Your task: Create selectedUser and set it to null. Create draftTitle without assigning a value. Log both variables.
Free with a JS Exercises account
Sign in to start coding, run your solution, and keep your progress saved for later. No payment needed.
By continuing, you agree to our Terms and Privacy Policy. We'll send occasional product updates and news. You can unsubscribe anytime.
Empty on Purpose
null means a developer deliberately put "nothing" into a variable. undefined means a variable exists but has not been given a value yet.
Your task: Create selectedUser and set it to null. Create draftTitle without assigning a value. Log both variables.