/    Sign up×
Community /Pin to ProfileBookmark

Cant solve a small js challenge

So I was going through code wars and I was trying to solve a simple js program given by the site .It goes like this ;
`function multiply(a,b)
{
a*b;
}`

my intial answer was
`function multiply(a,b)
{
var product=a*b;
return product;
}
var answer=multiply(10,10);
document.write(answer);`

But the site throws a bunch of errors ,what could I be doing wrong?

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@sibertMay 12.2021 — > @syedSaifuddin#1631525 But the site throws a bunch of errors ,what could I be doing wrong?

Do a jsfiddle and your errors will show up in plain text:

https://jsfiddle.net/np2t4hz0/
×

Success!

Help @syedSaifuddin spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 4.20,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...