Hey everyone i'm a newbie so please be nice. I've done a search and found stuff related to python but none to JS.
I'm half way through my code academy course on JS and am trying to apply what I've learnt so far in creating a simple numerology script. So far i've learnt functions, loops, variables, and array positions so i imagined this task should be achievable.
The aim is for the user to input their name and the script automatically calculate the value of it according to numerology rules.
For example:
A:1, J:1, S:1, B:2, K:2, T:2, C:3, L:3, U:3, D:4, M:4, V:4, E:5, N:5, W:5, F:6, O:6, X:6, G:7, P:7, Y:7, H:8, Q:8, Z:8, I:9, R:9
So the name TOM would equal 12 because of (2+6+4).
I haven't gotten very far regarding creating a working script and don't really know how to proceed. So far I'm able to isolate the first character in the name but I don't know how to convert it to a number, or how to do the same with the remaining characters:
var x = {A:1, J:1, S:1, B:2, K:2, T:2, C:3, L:3, U:3, D:4,
M:4, V:4, E:5, N:5, W:5, F:6, O:6, X:6, G:7, P:7, Y:7, H:8,
Q:8, Z:8, I:9, R:9};
name = prompt ("Type your name in CAPS"); //for example: TOM
name = name[0]; // first letter is T
console.log(name[0]); // prints T
console.log(x.T) // prints 2
console.log(x.(name[0])); //not working. I thought it would also print 2??