JavaScript JavaScript Functions Create Reusable Code with Functions Creating a Function

Iris Heidebrecht
seal-mask
.a{fill-rule:evenodd;}techdegree
Iris Heidebrecht
Front End Web Development Techdegree Student 9,663 Points

im having promble with this code

script.js
function sayHi() {
  const Hi;
}
index.html
<!DOCTYPE HTML>
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <title>JavaScript Basics</title>
</head>
<body>
<script src="script.js"></script>
</body>
</html>

2 Answers

Heidi Fryzell
seal-mask
MOD
.a{fill-rule:evenodd;}techdegree seal-36
Heidi Fryzell
Front End Web Development Treehouse Moderator 21,829 Points

Hi Iris,

The challenge is asking you to pop up an alert dialogue box that says "Hi".

In your code you have declared a variable called "Hi".

Here is the code to pop up an alert.

function sayHi(){
  alert("Hi");
};

Hope this helps and happy coding!

Heidi