# Problem with .fromCharCode() in Cipher

**URL:** <https://forum.freecodecamp.org/t/problem-with-fromcharcode-in-cipher/107357>\
**Category:** General\
**Created:** [April 19, 2017, 4:05am UTC](https://forum.freecodecamp.org/t/problem-with-fromcharcode-in-cipher/107357 "2017-04-19T04:05:47Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![arssonist](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/arssonist/32/73145_2.png) [@arssonist](https://forum.freecodecamp.org/u/arssonist)\
**Post date:** [April 19, 2017, 4:05am UTC](https://forum.freecodecamp.org/t/problem-with-fromcharcode-in-cipher/107357/1 "2017-04-19T04:05:47Z")

</div>

I’ve got an array of numbers that represent a word plus 13. But when I try to convert it back to numbers it does not work. I might be using it wrong but it’s what I saw in the MDN docs. Particularly starting with `String.`

Word to unicode plus 13  
the word TEST =\> `[97, 82, 96, 97]`

So  
`var arr = [97, 82, 96, 97]`

```
for (var i = 0; i < arr.length; i++) {
    console.log(String.fromCharCode(arr[i]))
}

```

`returns => a R ' a`

But why?

---

<div class="post-metadata">

**Author:** ![arssonist](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/arssonist/32/73145_2.png) [@arssonist](https://forum.freecodecamp.org/u/arssonist)\
**Post date:** [April 19, 2017, 6:03am UTC](https://forum.freecodecamp.org/t/problem-with-fromcharcode-in-cipher/107357/3 "2017-04-19T06:03:33Z")

</div>

So say if it needed to be raised by 13, and the starting point was 85, it would not be 98? Would it revert to the start again?

85 + 13, would be 68? This is just the solution that comes to mind based on what U said.

I didn’t get any of this from the information out of the original problem. I guess it makes sense (if I am interpreting correctly)

---

<div class="post-metadata">

**Author:** ![arssonist](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/arssonist/32/73145_2.png) [@arssonist](https://forum.freecodecamp.org/u/arssonist)\
**Post date:** [April 19, 2017, 9:16pm UTC](https://forum.freecodecamp.org/t/problem-with-fromcharcode-in-cipher/107357/5 "2017-04-19T21:16:14Z")

</div>

Oh, I thought it was between 60-90. So that was what I meant but 68.

I still don’t know how we even would have know this though.

I only learned about this being between the range 60-90 (incorrectly), and now 65-90, from reading the forum questions and from asking. It’s not something I ran into and I did read the docs.

Anyway, thanks!

---

<div class="post-metadata">

**Author:** ![ILM](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/ilm/32/363239_2.png) [@ILM](https://forum.freecodecamp.org/u/ILM)\
**Post date:** [January 17, 2021, 8:52pm UTC](https://forum.freecodecamp.org/t/problem-with-fromcharcode-in-cipher/107357/7 "2021-01-17T20:52:31Z")

</div>

Closed on January 17, 2021, 8:52pm UTC


