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
Team Scores Kata
You are responsible for programming the scoreboard for your local sandball team.
In sandball, each team has two players, and each player has their own score. At the end of the game, the team with the highest combined score wins the game.
Your scoreboard is aware of all four scores:
Home Team | Away Team |
---|---|
home1 | away1 |
home2 | away2 |
Each score will be an integer representing the number of points earned by that player.
Write a function that returns "home"
if the home team won the game, "away"
if the away team won the game, and "tie"
if each team's combined score is the same.
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