One thing that should help is to turn on the debugger in adobe reader in the preview pane. You can do this by right-clicking anywhere, click Page Display Properties, then click Javascript, and check off the console window.
From how you have things here you haven't defined nf as a variable. The console should error back stating that nf is undefined. If you create the array variable first it should work fine. Should look something like this:
var number = [];
number[0] = 2;
number[1] = 3;
var total = number[0] + number[1];
equals.rawValue = total;
This works as array variables. If you are trying to use field names, you need to change it slightly. The correct formatting to specifiy and instance of a field would be:
fieldname[1].rawValue = whatever variable or value
The problem here is that this syntax in Livecycle for specifying the instance of that field conflicts with the syntax for javascripting, the '[]' makes livecycle think that you are dealing with an array. So in order to get you need to use the structure:
xfa.resolveNode("fieldname[1]").rawValue
This then uses a function to resolves the node name and avoids trying to take the [] brackets literally.
Hope this helps, I had the same trouble. Just gotta get used to the syntax.
Josh