Find Jobs
Hire Freelancers

Fix JS function to remove array value case repetead

$10-30 USD

In Progress
Posted over 3 years ago

$10-30 USD

Paid on delivery
Hi, I have this function: function multiDimensionalUnique(arr) { var uniques = []; var itemsFound = {}; for(var i = 0, l = [login to view URL]; i < l; i++) { var stringified = [login to view URL](arr[i]); if(itemsFound[stringified]) { continue; } [login to view URL](arr[i]); itemsFound[stringified] = true; } return uniques; } function setAttr(param) { var attr = (typeof [login to view URL]('pAttr') == "undefined") ? '' : [login to view URL]('pAttr'); var attr_ = attr, flag = false, attrT = []; if (attr) { for (var i = 0; i < [login to view URL]; i++) { if((attr[i].option == [login to view URL] && attr[i].value != [login to view URL]) || (attr[i].option != param['option'])){ flag = true; } } if(flag) [login to view URL]({'option':[login to view URL], 'value':[login to view URL]}); else { $.each(attr_, function(i, v) { //[login to view URL](v.option+'-'+[login to view URL]); if([login to view URL]!=[login to view URL])[login to view URL]({'option':[login to view URL], 'value':[login to view URL]}); }); attr_ = attrT; } attr_ = multiDimensionalUnique(attr_); //[login to view URL](attr_); [login to view URL]('pAttr', attr_); } else { //[login to view URL](text); attr_ = [] [login to view URL]({'option':[login to view URL], 'value':[login to view URL]}); [login to view URL]('pAttr', attr_); } } My intention here is when I send param, like: setAttr({option:30, value: 1}); setAttr({option:30, value: 1275}); case i repetead the call: setAttr({option:30, value: 1}); I need to remove this val in "[login to view URL]('pAttr')"
Project ID: 27732336

About the project

8 proposals
Remote project
Active 4 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
8 freelancers are bidding on average $28 USD for this job
User Avatar
Hello there I can help modify the script to remove the attr on the second call of setAttr Let me know in advanced Ngan L Ba
$35 USD in 1 day
4.9 (457 reviews)
7.8
7.8
User Avatar
Hi, I am a JavaScript developer. I can make changes to your JavaScript setAttr function to remove the value when the function is called again with the same value.
$30 USD in 1 day
4.8 (117 reviews)
5.9
5.9
User Avatar
Hi, I am Full stack developer with more than 8 years of working experience in different technologies. I can fix provided js function. Let discuss in inbox. Thanks
$20 USD in 1 day
5.0 (28 reviews)
5.2
5.2
User Avatar
Hi Dear, I read your description carefully. I understood what you require me to do and I am filled with confidence that I can complete your project wonderfully. I have experience in web developing with PHP, Website Design, JavaScript, html, css, database such as MySQL over 5+ years. I ensure: => The Best Quality, => The Shortest Time. If you give me a chance, I will do my best to complete this project for us. I can complete this project with the best quality in time. I hope your kind reply. Best Regards. Chian Y.
$15 USD in 1 day
4.9 (4 reviews)
2.5
2.5
User Avatar
I have good experience with jquery/javascript. I can do this for you. I can asure you of best solution, quality codes and on time delivery. let's connect to proceed further
$25 USD in 2 days
5.0 (3 reviews)
2.4
2.4
User Avatar
✨✔⭐⭐Dear Employer⭐⭐✔✨javascript expert I sincerely wish you to be safe and always healthy on covid19. I have excellent APP development skills and extensive knowledge and practice in this part. I have excellent development experience and ability in this field, so it is safe to say that I am a very suitable developer for you. I will help you solve this project. Let's meet in the chat and discuss with you in detail.
$20 USD in 1 day
4.4 (5 reviews)
2.4
2.4

About the client

Flag of BRAZIL
Brasília, Brazil
5.0
77
Payment method verified
Member since Dec 11, 2016

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.