Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing example in function reference #1466

Open
ankur0904 opened this issue Dec 16, 2023 · 3 comments
Open

Missing example in function reference #1466

ankur0904 opened this issue Dec 16, 2023 · 3 comments

Comments

@ankur0904
Copy link

ankur0904 commented Dec 16, 2023

Increasing Access

Unsure

Most appropriate sub-area of p5.js?

Reference

Feature request details

Adding an example to the following code here

let square = number => number * number;
console.log(square(5));

will help in the following ways

  • Maintain consistency with the previous code snippets
    previous example code snippet
            let myName = 'Hridi';
            function sayHello(name) {
              console.log('Hello ' + name + '!');
            }
            sayHello(myName); // calling the function, prints "Hello Hridi!" to console.
  • give a good understanding to the user who is reading the reference i.e., what the code is doing.

My suggestions (suggested change)

let square = number => number * number;
console.log(square(5)); // calling the function and printing in console, prints "25" to console.  
@ankur0904
Copy link
Author

@limzykenneth What are your thoughts about the issue?

@ankur0904
Copy link
Author

@aakash-a-dev Please have a look at this comment

@limzykenneth
Copy link
Member

I'm not sure I personally like code comments that explains what the code should already describe.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants