You are going to be given an array of elements. Your job is to return an array which has duplicated each element
[1,2] => [1, 1, 2, 2]
['a', 'b'] => ['a', 'a', 'b', 'b']
const array = ['a', 'b']
array.doubleUp() // => ['a', 'a', 'b', 'b']
You are going to be given a word. Your job is to return the middle character of the word. If the word's length is odd, return the middle character. If the word's length is even, return the middle 2 characters.
"test" => "es"
"testing" => "t"
"middle" => "dd"
"A" => "A"
You are going to be a string. Your job is to return the count of each character in the string, in alphabetical order
"edward" => {
"a": 1,
"d": 2,
"e": 1,
"r": 1,
"w": 1,
}
"" => {
}
You are going to be an array of integers. Your job is to return an integer which is the difference between the highest and lowest integers in the array.
[3,1,7] => 6
[1721, 979, 366, 299, 675, 1456] => 1422
For each integer in the array, reorder the digits in ascending order before finding the difference between the lowest and highest.
[1721, 979, 366, 299, 675, 1456] => 1157
A user should see
- a title “Dice Roll App”, and a button to click
- three different random numbers from 1-6 every time they click the button.
No styling needed for this task.
- When the number is a 6, a 🔥 emoji should be displayed next to the number
- When the number is a 1, a 😭 emoji should be displayed next to the number