# Splice - NaN

**URL:** <https://forum.kirupa.com/t/splice-nan/177573>\
**Category:** flash\
**Created:** [February 3, 2006, 1:32am UTC](https://forum.kirupa.com/t/splice-nan/177573 "2006-02-03T01:32:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![redanchor](https://avatars.discourse-cdn.com/v4/letter/r/dbc845/32.png) [@redanchor](https://forum.kirupa.com/u/redanchor)\
**Post date:** [February 3, 2006, 1:32am UTC](https://forum.kirupa.com/t/splice-nan/177573/1 "2006-02-03T01:32:19Z")

</div>

The problem is, I’m trying to splice a number out of an array and use it later as a number, but when attempting to do so flash always returns NaN.

Example:

```auto
myArray = new Array(1, 2, 3);
var myVariable = myArray.splice(0, 1);
trace(myVariable);
//returns 1
trace(myVariable+1);
//returns NaN

```

I’ve tried strict data typing everything, moving some stuff around, but with no luck. How can I set this up so that I can use myVariable as a number?

Just a quick note, I have no NaN problems when removing elements from my array using pop() or shift() and later using them as numbers.

Thanks.
