Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

code challenges javascript

You can find many exercises at here: 
> https://www.jschallenger.com
There's also an online compiler on this site.

// iury.landin
Comment

javascript coding challenges with solutions

Q) Find all the duplicated values in given array.
	//input : [1,2,4,3,2,1,3]
	//output: [1,2,3]
Solution)

	var findDuplicates = (arr) => {
      let newArr = arr.filter((e,i ,a) => a.indexOf(e) != a.lastIndexOf(e) )
        return [...new Set(newArr)];
    };

    let nums = [1,2,4,3,2,1,3];
    let reqArr = findDuplicates(nums);
    console.log(reqArr);
Comment

PREVIOUS NEXT
Code Example
Javascript :: js sting first letter 
Javascript :: replace space with hyphen/dash javascript 
Javascript :: access session data from ejs view 
Javascript :: sublime format json 
Javascript :: conditionally changing styled components based on props 
Javascript :: window.print a div 
Javascript :: regexp constructor javascript 
Javascript :: emotion react 
Javascript :: falsy value javascript 
Javascript :: append meta tag to head javascript 
Javascript :: readystate in ajax 
Javascript :: javascript string interpolation 
Javascript :: js page auto reload 
Javascript :: refresh a page in the browser node js 
Javascript :: how to remove an element javascript html 
Javascript :: sh: /Users/ahmedqadri/Desktop/Projects/stockNotesAPP-frontend/node_modules/.bin/react-scripts: Permission denied 
Javascript :: ajax request in javascript 
Javascript :: table in text 
Javascript :: next js script 
Javascript :: how to check if a javascript object is empty 
Javascript :: how to filter nested array of objects in javascript 
Javascript :: delete with body angular 
Javascript :: reduce array to object javascript 
Javascript :: convert json string or parse 
Javascript :: if else alert js 
Javascript :: React JS CDN Links 
Javascript :: javascript make alert sound 
Javascript :: javascript count time 
Javascript :: orbit controls drei 
Javascript :: ajax upload image 
ADD CONTENT
Topic
Content
Source link
Name
6+4 =