+ 1

Best way to solve a logic error?

........

16th May 2019, 2:06 PM
Okiyo Stephen
Okiyo Stephen - avatar
3 Answers
+ 3
console.log all variables that are kind of important or that might be off. make sure to mark which value is what like this: console.log("x: " + x + ", y: " + y);
16th May 2019, 2:23 PM
Anton Böhler
Anton Böhler - avatar
+ 2
Ultimately, it depends upon what you're trying to do. If your logic is flawed in how you're thinking about or dealing with the problem, then you need to correct your understanding of the problem first. For example, if you think 2+2 is 7 then you'll never understand why you're getting 4 until you learn more. Get what I mean? What's the exact problem that you're having? It'll be much easier for us to help you with that. Over time your logic/problem-solving skills typically get better, but of course, some people are naturally better at it than others.
16th May 2019, 2:40 PM
AgentSmith
+ 1
In java it's System.out.println instead of console.log (just in case...)
16th May 2019, 2:24 PM
Anton Böhler
Anton Böhler - avatar