/    Sign up×
Community /Pin to ProfileBookmark

Javascript: indexof & substr

Im working on learning javascript . Im quite new as youll be able to tell .
Im working on devising a script that will help me with this problem :

[code]<b>You have 1 second to double and return: </b>
<hr><b>1847920588822</b><hr>[/code]

Every second the number changes and i have exactly one second to
double that number and return it . As you can see from the code .

I have been learning that there is way through javascript to pick up
those numbers , double them and submit them . In this single second .

indexof i used to find the first occurence of this value in the string .
substr i used to extract the exact number .
now i need to double it and submit it .

Can anyone give me some insight on how i can go about writing this ?

Thanks ,
Neqtan

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@KorSep 11.2007 — ok, now, is easy to double a number. Unfortunately, to make the problem solvable you must "translate" it into the "client-side language", if I may say so.

Where that value comes from? Who counts the seconds? Where is that form to submit that value? Which is the user's action who will double that number? And, after all, what is the use of all these? Is this a game? How's that game?
×

Success!

Help @Neqtan 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 5.18,
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: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

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