About the section on comments

ok , im in the section where it talks about comments , I really don’t understand why they are use or when do we use them , I was hoping someone can clear this for me , ( a little tip , I’m a beginner all this is new too me )

Program:

var addAB = function (a, b) {
    return a + b;
};

On sight it might be obvious to some what this function does, but it cannot hurt to show what the author intends it to do. A comment is how the author documents their program.

// function to return A plus B
var addAB = function (a, b) {
    return a + b;
};

ok so if a comment is how the author documents their programs…
can you show me some examples plz?
and I see that you wrote var addAB = function (a,b) …etc what does that mean

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.