Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
# Hello WorLd

This is an aw esome javaScript program that has like a bunch of cool functions and stuff.
This is an awesome JavaScript program that has interesting functions and features.

## helloWorld()

spits out the text 'Hello, World" to the console.
Logs the text "Hello, World" to the console.

## helloName(name)

takes a var and then it says "Hello, Ann" if name is "Ann".
Takes an input string and then logs it as follows: "Hello, [string]", where [string] represents the input.

## Instrcutions
## Instructions

1. fork this repositary.
3. Clone your forked repo to ur local machine with `git clone`.
4. In ur command line terminal, `cd` into the folder and run `node helloworld.js`.
1. Fork this repository.
3. Clone your forked repo to your local machine with `git clone`.
4. In your command line terminal, `cd` into the folder and run the command: `node helloworld.js`.
16 changes: 9 additions & 7 deletions helloworld.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
function helloWorld(){
console.print("Hello, World"); //I don't know why this doesn't work.
}
console.log("Hello, World"); // I don't know why this doesn't work.
} // That was because the function you were looking for was actually console.log!

function helloName(name){
console.log(`Hello, $name`); //Idk why it prints out "Hello, $name" instead of "Hello, Ann"
}
console.log(`Hello, ${name}`); //Idk why it prints out "Hello, $name" instead of "Hello, Ann"
} // It seems you were missing the curly braces around 'name'. You were on the right track though!

//Tried to invoke both functions here but I get an error :(
helloWorld()
helloName("Ann")
// Tried to invoke both functions here but I get an error :(
helloWorld();
helloName("Ann");
// How are you invoking them? Perhaps check to see if you are in the right folder location in terminal.
// Otherwise it may be because of the errors I have now corrected.