r/JavaScriptTips • u/[deleted] • Apr 17 '23
Help
I’m working on a sample problem for ATA and I keep getting an “illegal parenthesized expression” error. Can someone tell me what I’m doing wrong and how can I fix it?
0
Upvotes
r/JavaScriptTips • u/[deleted] • Apr 17 '23
I’m working on a sample problem for ATA and I keep getting an “illegal parenthesized expression” error. Can someone tell me what I’m doing wrong and how can I fix it?
4
u/Extension_Spirit8805 Apr 17 '23 edited Apr 17 '23
This post is cursed! this is absolutely not javascript, you're either using java or C#, seeing this looks like Eclipse, I'll assume the former.
First off, I am unsure on what you are reinitializing "weights" for, just use the array "weights" that you passed in the parameter. Also on line 18, you are trying to get each float number in the array, right? I think you'll need to do something like "weight = weights[i]".
If you can make clear to those 2 remarks, I think you'll be able to figure out the rest on how to make this function work the way you want it to!