- This project consists of two main parts:
- Dynamically adding images to a list in an HTML document.
- Implementing a linear search function in JavaScript.
- Dynamically creates list items with images and appends them to an unordered list.
- A simple linear search function that finds the index of a target number in a given array.
Adding Images to the List
This script selects an unordered list from the HTML document body and dynamically creates list items, each containing an image from a given array of image sources. The images are then appended to the unordered list.
Linear Search Function
The linear search function prompts the user to enter an array and a target number, then searches for the target number in the array and returns its index. If the target number is found multiple times, it returns the index of the last occurrence.