GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — 50DaysOfJavaScript/Day-22 at main · syedsohan/50DaysOfJavaScript

Expand file tree

/

Day-22

/
Copy path

Directory actions

More options

More options

Directory actions

More options

More options

Latest commit

 

History

History
History
/

Day-22

/
Copy path

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
README.md
README.md
 
 
uniqueInOrder.js
uniqueInOrder.js
 
 

README.md

Outline

Unique In Order.

Instructions

Implement the function unique_in_order which takes as argument a sequence and returns a list of items without any elements with the same value next to each other and preserving the original order of elements.

The argument can contain a string or an array.

For example:

uniqueInOrder([1,2,2,3,3]) should return [1,2,3]

uniqueInOrder('ABBCcAD') should return ['A', 'B', 'C', 'c', 'A', 'D']

Challenges (0/3 done)

  • uniqueInOrder('AAAABBBCCDAABBB') should return ['A', 'B', 'C', 'D', 'A', 'B'].
  • uniqueInOrder('ABBCcAD') should return ['A', 'B', 'C', 'c', 'A', 'D'].
  • uniqueInOrder([1,2,2,3,3]) should return [1,2,3].
let uniqueInOrder = (iterable) => {
  //your code here - remember iterable can be a string or an array
};
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.