---
title: "Discussion on \"JS Linear Search\" | Hashnode"
description: "Discussion on \"JS Linear Search\". Sequentially checks the target value in given list and match found.\nTime Complexity:\n     best  :  O(1)\n     Worst: O(n)\nSpace Complexity:  O(1)\nfunction linearSearch(arr, target) {\n    for (let i in arr) {\n        if(arr[i] === target) return i;\n   ..."
url: "https://hashnode.com/posts/js-linear-search/61e2e3c2d546507ab0344cab"
---

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

Discussion

# [JS Linear Search](https://vkglobal.hashnode.dev/js-linear-search?utm_source=hashnode&utm_medium=feed)

Sequentially checks the target value in given list and match found. Time Complexity: best : O(1) Worst: O(n) Space Complexity: O(1) function linearSearch(arr, target) { for (let i in arr) { if(arr\[i\] === target) return i; ...

Jan 15, 2022 · 1 min read · vkglobal.hashnode.dev  
Read the article

-   [#javascript](https://hashnode.com/tag/javascript)
-   [#100daysofcode](https://hashnode.com/tag/100daysofcode)

## Written by

[Mahesh](https://hashnode.com/@urstrulyvishwak)

@urstrulyvishwak · India

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

Dad | Web developer

## Responses 1

Markdown supported · ⌘↵ to post

[Saleh Mubashar](https://hashnode.com/@Saleh28)

[Jan 15, 2022](https://hashnode.com/posts/js-linear-search/61e2e3c2d546507ab0344cab/comment/61e3013ff652e91821d57e0b)

Nice post, Kindly check out mine too thanks

[Mahesh](https://hashnode.com/@urstrulyvishwak)

[Jan 15, 2022](https://hashnode.com/posts/js-linear-search/61e2e3c2d546507ab0344cab/comment/61e3013ff652e91821d57e0b#reply-61e301e8d546507ab034500d)

Sure. Thank you.

[Saleh Mubashar](https://hashnode.com/@Saleh28)

[Jan 15, 2022](https://hashnode.com/posts/js-linear-search/61e2e3c2d546507ab0344cab/comment/61e3013ff652e91821d57e0b#reply-61e30583f652e91821d57e82)

[Vishwak](https://hashnode.com/@vkglobal) would appreciate if you follow me too :) thanks
