Essential JavaScript
Introduction
JavaScript Basics
Numbers
Strings
Logic
Variables
Loops
Objects
Arrays
Arrays Intro
Making Arrays
Array Builder Kata
Array Elements
Human Names Kata
Array Length
Longest Array Kata
Looping Over Arrays
Highest Number Kata
Word Hunter Kata
Array Average Kata
Min-Max Kata
Adding Elements
Number Range Kata
Removing Elements
Arrays of Objects
Biggest Animal Kata
Arrays of Arrays
Taboo Words Kata
Going Further
Essential JavaScript
Introduction
JavaScript Basics
Numbers
Strings
Logic
Variables
Loops
Objects
Arrays
Arrays Intro
Making Arrays
Array Builder Kata
Array Elements
Human Names Kata
Array Length
Longest Array Kata
Looping Over Arrays
Highest Number Kata
Word Hunter Kata
Array Average Kata
Min-Max Kata
Adding Elements
Number Range Kata
Removing Elements
Arrays of Objects
Biggest Animal Kata
Arrays of Arrays
Taboo Words Kata
Going Further
Human Names Kata
You are helping translate human speech into computer terms.
You will be given a list of names
, and you will return one of those names.
You will also be given a position
. This number is the position of the name you need to return in human terms.
In other words, you will need to translate the human number into a computer index. So if the number is 1
, meaning the first item in the list, you need to return the array element at index 0
, since that is the first element in the array.
For example:
const names = ['Alex', 'Bri', 'Cory', 'Diana']; const result = getNameAtPosition(names, 2); console.log(result); // "Bri"
Code Editor
Click "Run Tests" to execute your function and see the test results below.
Test Results
Run your code to see test results
Console Output
// Console output will appear here...
0 output lines