v1
- by kylemit 1/22/202200
Setup HTML - click to add setup HTML
disable setup JavaScript
Setup JavaScript
// list with no duplicates
const input = ['Aardvark','Alligator','Alpaca','Anaconda','Ant','Antelope','Ape','Aphid','Armadillo','Asp','Ass','Baboon','Badger','Bald Eagle','Blue Jay','Blue Whale','Bobcat','Buffalo','Butterfly','Buzzard','Camel','Caribou','Carp','Cat','Caterpillar','Catfish','Cheetah','Chicken','Chimpanzee','Chipmunk','Crane','Cricket','Crocodile','Crow','Cuckoo','Deer','Dinosaur','Dog','Dolphin','Donkey','Dove','Dragonfly','Duck','Eagle','Eel','Elephant','Emu','Falcon','Ferret','Finch','Fish','Flamingo','Flea','Fly','Fox','Frog','Goat','Goose','Gopher','Gorilla','Grasshopper','Hamster','Hare','Hawk','Hippopotamus','Horse','Hummingbird','Humpback Whale','Husky','Iguana','Impala','Kangaroo','Ladybug','Leopard','Lion','Lizard','Llama','Lobster','Mongoose','Monitor lizard','Monkey','Moose','Mosquito','Moth','Mountain goat','Mouse','Mule','Octopus','Orca','Ostrich','Otter','Owl','Ox','Oyster','Panda','Parrot','Peacock','Pelican','Penguin','Perch','Pheasant','Pig','Pigeon','Polar bear','Porcupine','Quail','Rabbit','Raccoon','Rat','Rattlesnake','Raven','Rooster','Sea lion','Sheep','Shrew','Skunk','Snail','Snake','Spider','Tiger','Walrus','Whale','Wolf','Zebra']
delete caserun single casemove downdrag and drop case


ready



const hasDuplicate = (array) => {
	return array.some((entry, index) => array.indexOf(entry) !== index)
}

hasDuplicate(input)
delete caserun single casemove upmove downdrag and drop case


ready



const hasDuplicate = array => (new Set (array)).size < array.length;

hasDuplicate(input)
delete caserun single casemove updrag and drop case


ready



const hasDuplicate = (arr) => {
  let set = new Set()
  return arr.some(el => {
    if (set.has(el)) { return true }
    set.add(el) 
  })
}

hasDuplicate(input)
Test Case - click to add another test case
Teardown JS - click to add teardown JavaScript
Output (DOM) - click to monitor output (DOM) while test is running
RUN