---
title: "stretchNumericalArray | 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 stretchNumericalArray

-   stretchNumericalArray(source: number\[\], targetLength: number): (number | null)\[\][](#stretchnumericalarray)
    
    "Stretches" an array of numbers to a new length, filling in null values for the new indices.
    
    #### Parameters
    
    -   source: number\[\]
        
        the array to stretch
        
    -   targetLength: number
        
        the length to stretch to
        
    
    #### Returns (number | null)\[\]
    
    the stretched array with null values
