Congratulations! Your test results must have caught the eye of someone high up, because you're being promoted to Problem Solver!
Today, we're going to be writing some basic code for use in a top-secret melon-oriented program whose purpose is [INFORMATION REDACTED]. I'm sure you grasp the importance of this project, and that writing error-free code is paramount. Test data is given, but I'm sure there are more cases you might be able to think of.
###Your Assignment###
Given an array in Javascript, write a function in Javacsript that returns any items that have duplicates. The data contained in the array may be an integer or a string, or a boolean, but it will not be an array or a Javascript object.
Here's some test data:
var votesToGoEatCake = [true, true, true, true]
// Should return in no particular order:
// [true]
var hackbrightStudents = ["katie", "amy", "jenny", "katie", "kelley", "katie", "amy"]
// Should return in no particular order:
// ["katie", "amy"]
var classroomIds = ["47","12", "19", "22", "26", "99", "30", "50", "324", "003", "44",
"33", "346", "354", "44", "235", "45", "34", "44", "590", "09", "099", "0", "1", "3",
"33", "999", "9"]
// Should return in no particular order:
// ["44", "33"]
var randomJunkIFound = ["katie", "true", true, 19, "gargoyles", "!", 2 + 3, "2 + 3",
19, "19", 19 === "19", 6, false, false]
// Should return in no particular order:
// [19, false]