Possibe error in code example
See original GitHub issueDescribe the Issue
The example shows “const thirdLetter = alpha[2]”. Below that, the snippet of text says that alpha[2] should be “Y”. “thirdLetter is the string Y, lastLetter is the string C, and valueLookup is the string Y.”
Affected Page
const alpha = {
1:"Z",
2:"Y", //<--------------- thirdLetter ??
3:"X",
4:"W",
...
24:"C", //<--------------- lastLetter ??
25:"B",
26:"A"
};
const thirdLetter = alpha[2];
const lastLetter = alpha[24];
const value = 2;
const valueLookup = alpha[value];
The snippet has the below explanation in the instructions:
`thirdLetter` is the string `Y`, lastLetter is the string `C`, and `valueLookup` is the string `Y`.
Expected behavior
I believe correcting the const “thirdLetter” to “secondLetter” could be less confusing.
Issue Analytics
- State:
- Created a year ago
- Comments:16 (14 by maintainers)
Top Results From Across the Web
The 7 Most Common Types of Errors in Programming and ...
Resource errors are an example of a type of error in programming that might be something for the operations team to fix rather...
Read more >Incorrect program example: Using the error code parameter
The error code parameter provides a way for you to determine whether an API encounters any errors. Here are the program examples that...
Read more >7 Common Programming Errors | Remote Coding in San Diego
1. Runtime errors. These bugs occur when the code “won't play nice” with another computer, even if it worked perfectly fine on the...
Read more >Errors and exceptions - Object-Oriented Programming in Python
Here are some examples of syntax errors in Python: myfunction(x, y): return x + y else: ... Find potential sources of runtime errors...
Read more >Types of Errors in Java with Examples - GeeksforGeeks
Error is an illegal operation performed by the user which results in the abnormal working of the program. Programming errors often remain ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I like that example better. I think we should use it + the corresponding text fixes that would be needed.
I can’t think of a better example to be honest, but we can use a practical one. Like how the freeCodeCamp codebase Json files structured.