codesandbox / codesandbox/codesandbox-client
Parsing issue giving wrong output on codesandbox console
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 13.6k
- Forks
- 2.4k
- Avg merge
- 6d 19h
- Merged PRs (30d)
- 2
Description
🐛 bug report
let array = [1, 5, 3, 5, 6, 8];
const checkFun = (num1, num2) => {
for (let i = 0; i < array.length; i++) {
if (array[i] === num1) array[i] = num2;
}
};
console.log("before", array);
//Expected - [1, 5, 3, 5, 6, 8]
//Output - [1, 10, 3, 10, 6, 8]
checkFun(5, 10);
console.log("after", array);
If I run the same code on the console of any browser , its giving me the correct output . The console of codesandbox is giving a different and not-expected output.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the provided JavaScript snippet in the CodeSandbox console and compare its output with a browser console. Trace the console's parsing or execution entry point to determine where the observed output diverges; done means the same snippet produces the expected array without regressing related console behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100