in real life, ring would throw an error into the console, and then the “return” command would execute,
Actually, the code causes an error and prevents the
return sword; line from executing.
You can check it out by running the code, along with a call to the
… your code would “work” in the sense that “sting” would get sent wherever you wanted it to be sent.
Code before the call to
ring would work yes, but I’m not quite getting what you’re aiming for here. Part of my issue I think is not understanding your use of “sent.”
I may though get the gist of what you’re saying: put in a couple
console.logs into the code, one before the call to
ring and one after, and ask which get called. Correct? I do think that may improve things by making it more tangible, so thanks for the suggestion! It would then be a multiple choice question, and although not a question-type available when the course was developed, so it can’t be done in this particular version of the course, our newer platform does have that ability. Migrating the course over would make that possible, and is something that is being worked on and may happen down the road.
If I misunderstood something, please let me know!