Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tpyo inserts value '2' to arrays #5

Open
lo1tuma opened this issue Feb 27, 2014 · 1 comment · May be fixed by #6
Open

tpyo inserts value '2' to arrays #5

lo1tuma opened this issue Feb 27, 2014 · 1 comment · May be fixed by #6

Comments

@lo1tuma
Copy link

lo1tuma commented Feb 27, 2014

I played a little bit with tpyo in the interactive node shell and noticed that tpyo inserts the value 2 to any array passed to the tpyo function.

$ node --harmony
> var tpyo = require('tpyo');
undefined
> var foobar = [1,2,3,4,5];
undefined
> foobar
[ 1, 2, 3, 4, 5 ]
> tpyo(foobar)
6
> foobar
[ 2,
  1,
  2,
  3,
  4,
  5 ]
> var t = [9,8,7,6,5]
undefined
> t
[ 9, 8, 7, 6, 5 ]
> tpyo(t)
6
> t
[ 2,
  9,
  8,
  7,
  6,
  5 ]
> t = ['a', 'b', 'c']
[ 'a', 'b', 'c' ]
> t
[ 'a', 'b', 'c' ]
> tpyo(t)
4
> t
[ 2, 'a', 'b', 'c' ]
@lo1tuma
Copy link
Author

lo1tuma commented Feb 27, 2014

Here is another example without interactive shell:

var tpyo = require('tpyo');
var foobar = tpyo([1,2,3,4,5]);

console.log(foobar);
console.log(foobar.toStr1ng());

console.log(foobar) seems to be the problem.

@sudodoki sudodoki linked a pull request Nov 16, 2014 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant