Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

My question is what is debugging and how do I debug my codes?

+4 votes
asked Aug 3, 2023 by Wilson Omonz (160 points)
Hello fellow students.
I am new to this platform and also new to programming languages as well.
My question is what is debugging and how do I debug my codes?

My second question is what are the below signs used for?

( ),  =>,   { },  ==,  ===,  !=,  !==, >=,  <=, [ i ] ,

Hoping to hear from someone soon. Thanks

2 Answers

0 votes
answered Aug 3, 2023 by Peter Minarik (86,240 points)
edited Aug 3, 2023 by Peter Minarik

Are you learning Javascript? It would not be my choice of first language to learn (see why).

Debugging

When your code does not work correctly, it is often referred to that it has a bug. Searching for a bug in a program is called debugging. After you found the bug, you need to understand why it happens and how the program should correctly behave. Only after this can you apply the fix.

Debugging JavaScript is not as simple as C/C++, C#, Java, as JavaScript is run in your browser.

JavaScript is typically debugged via a browser extension (e.g. Chrome DevTools).

Here is also a bit of info on JavaScript debugging.

Getting started

Again, I would advise you to learn a different language than JavaScript for your first language (e.g.: C, C++, C#, Python, Java; hell, even the good old Pascal would be better for new starters than JavaScript) to make your life easier.

Regardless of what language you learn, you'll need to find some nice online tutorials, e.g.:

and many more.

For your operator questions, I'll refer you to one of the pages on the sites above: https://www.w3schools.com/js/js_operators.asp.

What is not mentioned on that very page are the following:

(): used for many things, e.g. parenthesis for expressions; function arguments list

function CalculateAverage(a, b) {
  return (a + b) / 2;
}

{}: defining a scope, e.g. the body of a function (see above)

=>: lambda function definition

average = (a, b) => (a + b) / 2;
console.log(average(3, 8));

[]: indexing (of an array or list); most programming languages use 0-based indexing

let names = ['Albert', 'Betty', 'Cain']
console.log('second name:', names[1]);

All of these will be very shortly explored if you follow the tutorials of any of your preferred tutorials site.

Good luck!

0 votes
answered Aug 9, 2023 by piyush (140 points)

In simple terms debugging is to find the errors in your written program. you can debug your code from your compiler. It is provided in every compiler, 

() is used for inserting strings in functions. >=, ==, !=. <= all are comparing operators, that is to compare the values of distinct values. { } is used after a function, content of function is written in it. [ i ] is used in arrays.

Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...