/    Sign up×
Community /Pin to ProfileBookmark

Can Anyone explain this code to me

I know very little about Javacript.

As far as I can tell —- this code reads data from a cookie and populates a picksheet.

function rePickIt(){
//alert(document.cookie)
thePicks = new Array();
if(allPicks=(document.cookie+’;’).match(/allPicks=(.+);/)){
allPicks=unescape(allPicks[1]).split(‘,’)
for(i=0;i<allPicks.length;i++)
if(pick=allPicks[i].match(/pick(d+)=(d+)/)){
thePicks[pick[1]]=pick[2];
//alert(pick[1]+’: ‘+pick[2])
}
for(p=0;p<thePicks.length;p++)
if(thePicks[p]){
PickIt(p, thePicks[p])

//alert(p+’>>’+ thePicks[p])
}
}
}

What I want to do is add a piece of code that would stop the populating after the 32nd pick. It can have a total of 63 picks.

If there are less in the cookie ( it could have any number between 1 and 63) that is not a problem.

Please help.

to post a comment
JavaScript

0Be the first to comment 😎

×

Success!

Help @hiewall 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.5,
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,
)...