Hello 

This is the day 20 of #30 days of javascrip coding, at this day I studied Searching Array Lesson i learned that
1- The first thing I need to do is indexOf without specifying where the search will start. The result will be that it will find the element. It becomes the first name and its indexing is 0.
2-Using the indexOf with a selection, we will start the search from index 2. The result will be that the element has the last name and its indexing is 4.
3- For LastIndexOf, it is used to search from the last to the first. This means that it will start the search from the end of the array and find the element at the end. Then, the normal count of the index will start from the beginning until it reaches the last index, which will be numbered 4.
4- I use includes to ask whether this array contains the element? If, oh, it remains True, even if it does not, then it remains False
5-We can use If Condition here to test whether the element exists or not. If it exists, print Yes, and if it does not exist, print Not Found
That's what I learned today and this is the codes i have typed

Comments

Popular posts from this blog