---
title: "findNextEntryAndIndexWithValue | JavaScript maps SDK"
description: "Documentation for MapTiler SDK"
---

> For AI agents: a documentation index is available at [/llms.txt](https://docs.maptiler.com/llms.txt). Markdown versions of all pages are available by appending .md to any URL.

# Function findNextEntryAndIndexWithValue

-   findNextEntryAndIndexWithValue(  
        arr: [NumericArrayWithNull](https://docs.maptiler.com/sdk-js/api-reference/types/NumericArrayWithNull/),  
        currentIndex: number,  
    ): (number | null)\[\][](#findnextentryandindexwithvalue)
    
    Looks ahead in an array for the next entry that is not null.
    
    #### Parameters
    
    -   arr: [NumericArrayWithNull](https://docs.maptiler.com/sdk-js/api-reference/types/NumericArrayWithNull/)
        
        The array to search through
        
    -   currentIndex: number
        
        The index to start searching from
        
    
    #### Returns (number | null)\[\]
    
    \[index, value\] A tuple containing the index of the next entry and its value, or null if not found
