Q. What will the following JavaScript code snippet do? If not, what will be the error?

Code:
function letsfindcourse(lfc)
{
for (; lfc.next; lfc = lfc.next) ;
return lfc;
}
  • (A) No, this will result in a runtime error with the message Cannot use Linked List
  • (B) No, this will not iterate
  • (C) Yes, this will work
  • (D) No, this will throw an exception as only numerics can be used in a for loop
πŸ’¬ Discuss
βœ… Correct Answer: (C) Yes, this will work

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
255
Total Visits
πŸ“½οΈ
4 y ago
Published
πŸŽ–οΈ
Ram Sharma
Publisher
πŸ“ˆ
84%
Success Rate