Skip to content

Implement Arrow Functions for Basic Number Operations #3

Description

@CodelineAtyab

User Story: Implement Arrow Functions for Basic Number Operations

Title

As a developer, I want to implement and use arrow functions for basic number operations so that I can understand their syntax and usage in JavaScript.

Acceptance Criteria

  • An arrow function should be implemented that takes a number as input and prints it to the console
  • An arrow function should be implemented that takes a number as input and returns true if even, false if odd
  • Both functions should work correctly with positive and negative integers
  • The functions should be demonstrable with any array of numbers
  • The implementation should include comments explaining how the arrow functions work
  • The code should follow modern JavaScript best practices
  • The functions should handle invalid inputs gracefully (e.g., non-numbers)

Example Input and Output

Example 1: Print Numbers Function

Input:

const numbers = [1, 5, 10, -3, 22];

Output:

1
5
10
-3
22

Example 2: Even/Odd Check Function

Input:

const numbers = [1, 2, 3, 4, 5, 6];
console.log(results);

Output:

[2, 4, 6]

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions