#Expected unexpected output

6 messages · Page 1 of 1 (latest)

opal prawn
#

Hello! I am a little confused as to why the output for this is "I bring you presents: money and empty" I understand why "money" is chosen in the comparison, but I dont understand why rightHand is the only one to be affected by the 'empty' initiation.

This is an exercise question. Thank you for your time!

tender cipher
#

are you trying to set the value of both leftHand and rightHand to empty?

opal prawn
#

No, it is a question like "Write the output of the function and why"

So im just trying to figure out why the

var lefthand, righthand = 'empty"

declaration doesnt apply to both left and right hand. Maybe its just the way it is in javascript?

tender cipher
#

because you only assign a value to the rightHand variable

#

the leftHand stays without a value

#

declaration doesnt apply to both left and right hand, yea