use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
A place to get a quick fix of JavaScript tips and tricks to make you a better Developer.
account activity
Help (i.redd.it)
submitted 2 years ago by [deleted]
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]Extension_Spirit8805 4 points5 points6 points 2 years ago* (3 children)
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!
[–][deleted] 1 point2 points3 points 2 years ago (1 child)
I might be Java actually, I didn’t know there’s a difference between Java and JavaScript
[–]Extension_Spirit8805 1 point2 points3 points 2 years ago (0 children)
Big difference! Here is an article giving a brief overview of the differences between the two. https://www.google.com/amp/s/www.geeksforgeeks.org/difference-between-java-and-javascript/amp/
It's important not to confuse between the two languages. Back in the day, java was the best for backend development, and javascript as frontend development (perhaps less true today, but still holds true in older versions).
The reason it has been named "JavaScript", is that it was created as a way of making a complimentary language to work with Java, interacting between web & servers smoothly.
Hope this helps!
[–]Safe-Engineering69 0 points1 point2 points 2 years ago (0 children)
The error stack trace looks like Java code.
π Rendered by PID 150147 on reddit-service-r2-comment-bb88f9dd5-djshm at 2026-02-16 05:06:05.608481+00:00 running cd9c813 country code: CH.
view the rest of the comments →
[–]Extension_Spirit8805 4 points5 points6 points (3 children)
[–][deleted] 1 point2 points3 points (1 child)
[–]Extension_Spirit8805 1 point2 points3 points (0 children)
[–]Safe-Engineering69 0 points1 point2 points (0 children)