1,009 B
1,009 B
Find First Occurrence of a Number in an Array
Description
This utility takes a user input of array items and target input. The code finds the first occurrence of the target number in the given array which will be sorted.
Table of Contents
Installation
To use the code in this repository, you need to have Node.js installed on your machine. Clone the repository to your local system using the following command:
git clone https://github.com/afiqzudinhadi/first-occurrence.git
Install the required dependencies by running the following command:
npm install
Usage
- Navigate to the repository's root directory.
- Open terminal or command prompt.
- Run the following command to execute the code:
npm run index
- Follow the on-screen instructions to input the array or string and the element you want to find the first occurrence of.