Question: I have a pricing array

```
pricing = new Array();

pricing[1] = 35;
pricing[2] = 60;
pricing[3] = 84;
pricing[4] = 104;
pricing[5] = 120;
pricing[6] = 132;
pricing[7] = 140;
pricing[8] = 144;
pricing[9] = 153;
pricing[10] = 160;

```

Everything below 10 has a price, everything above 10 will have the same price as ten

It only goes to 20 so what i did originally was just repeat the price for 11 - 20. But thats wasteful, how can I tell me array that everything > 10 = 160

p.s my final version of this is condensed :)

Answer: 
You can leave your array as is and use a function like:

```
var getPrice = function(arr, index){
    return arr[index > 10 ? 10 : index];
}

```
You missed the first entry in your array (since it is 0 based). I would change it to this: 

```
pricing = new Array(20);

pricing[0] = 35;
pricing[1] = 60;
pricing[2] = 84;
pricing[3] = 104;
pricing[4] = 120;
pricing[5] = 132;
pricing[6] = 140;
pricing[7] = 144;
pricing[8] = 153;
pricing[9] = 160;

```

Then you can set the last 10 using this: 

```
for(var x = 10; x < pricing.length; x++) {
    pricing[x] = pricing[9];
}

```

[Example fiddle](http://jsfiddle.net/KwAga/).