Skip to content

Missing example in function reference #1466

Open
@ankur0904

Description

@ankur0904

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.  

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions