---
title: "Discussion on \"JavaScript indexOf and lastIndexOf methods and how to use them.\" | Hashnode"
description: "Discussion on \"JavaScript indexOf and lastIndexOf methods and how to use them.\". indexOf() and lastIndexOf() are string methods in JavaScript that are used to search for a substring within a given string. The indexOf() method returns the index of the first occurrence of the specified substring, while the lastIndexOf() method retu..."
url: "https://hashnode.com/posts/javascript-indexof-and-lastindexof-methods-and-how-to-use-them/64365be6f7d8baabcca97b71"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [JavaScript indexOf and lastIndexOf methods and how to use them.](https://lukechidubem.hashnode.dev/javascript-indexof-and-lastindexof-methods-and-how-to-use-them?utm_source=hashnode&utm_medium=feed)

indexOf() and lastIndexOf() are string methods in JavaScript that are used to search for a substring within a given string. The indexOf() method returns the index of the first occurrence of the specified substring, while the lastIndexOf() method retu...

Apr 12, 2023 · 1 min read · lukechidubem.hashnode.dev  
Read the article

-   [#javascript](https://hashnode.com/tag/javascript)
-   [#indexof](https://hashnode.com/tag/indexof)
-   [#lastindexof](https://hashnode.com/tag/lastindexof)

## Written by

[Luke Chidubem](https://hashnode.com/@lukechidubem)

@lukechidubem

  
[View profile](https://hashnode.com/@lukechidubem)

I am a proactive Full-Stack Software Engineer, works with JavaScript, NodeJs, TypeScript

I am a proactive Full-Stack Software Engineer with a background in Business and Maritime Management. I specialized in JavaScript, HTML, CSS, NodeJS, ExpressJS, ReactJS, NextJS, TypeScript and more. I possess strong skills in problem solving, communication, and collaboration that leads to quality products &amp; results. I also love Meeting with the software development team to define the scope and scale of software projects thereby leading to the software architectural design. I am equally eager to expand my knowledge and implement what I have learnt in a practical and professional environment.

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
