Khan / Khan/live-editor

Yoko Oh Noes confused about hoisting and loops

Open
#733 4 comments 0 reactions 0 assignees View on GitHub
bug pjs
Dominant language
JavaScript
Stars
776
Forks
180
PR merge metrics
No merged PRs in 30d

Description

See the demo program at https://www.khanacademy.org/computer-programming/confused/5208304615768064 . It attempts to initialize a variable declared inside the body of a loop to **undefined** causing the complaint "It's not necessary to initialize 't' to 'undefined'." which is certainly not the case.

Contributor guide

No contributing guide indexed for this repository

Research direction

Open the linked Khan Academy demo first and reproduce the warning about initializing 't' to 'undefined'. Then locate the live editor diagnostic that reports this message and determine why the loop-scoped declaration is treated as unnecessary; done means the valid example no longer produces the complaint.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
developer-experience
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.