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 :: jsconfig 
Javascript :: recoil js 
Javascript :: what is functional programming 
Javascript :: how to send message to user in socket.io 
Javascript :: how to connect socket in react js 
Javascript :: javascript rest parameters vs spread operator 
Javascript :: nodejs check if file is running on server or client 
Javascript :: js execute function evry second 
Javascript :: javascript create anchor link 
Javascript :: jquery default value 
Javascript :: this.jsObject.functions is not a function 
Javascript :: react return multiple components 
Javascript :: window.history 
Javascript :: button ref react 
Javascript :: simultaneos mouse buttons clicked js 
Javascript :: react native select simulator 
Javascript :: calculate 7 days in javascript countdown 
Javascript :: check if specific letter exist in string javascript 
Javascript :: mongodb find array with element 
Javascript :: add a string regex in angular input 
Javascript :: ask for expo token and save to firebase 
Javascript :: The JavaScript Apply() Function 
Javascript :: how to assert input value in testing library 
Javascript :: how to check url with port is valid or not regex javascript 
Javascript :: redux thunk 
Javascript :: getusermedia close stream 
Javascript :: .env file example react native 
Javascript :: slice javascript 
Javascript :: javascript prevent right click 
Javascript :: how to create an object in javascript 
ADD CONTENT
Topic
Content
Source link
Name
4+4 =