Question: In Javascript, how do I convert a string representation of a hex value into it's hex representation ?

What I have returning from a checksum routine is a string value "FE". What I need is it's hex representation "\xFE"

I cannot simply do this, as it gives me an error:

```
var crc = "FE";
var hex = "\x" + crc;

```

This just gives me a new 4 character ASCII string:

```
var crc = "FE";
var hex = "0x" + "FE";

```

thxs for any guidance.

Answer: 
like this

```
var hex = parseInt("FF", 16);

```
For the *string* `\xFE`, escape the backslash: `var hex = '\\x'+'FE'`

To convert `'FE'` to a Number use `+('0xFE')`

To show `+('0xFE')` as a hexadecimal, use `(224).toString(16)`, or `'0x'+((254).toString(16))`