From e641760b84e7324e9f12550daa50a4b87eaa247e Mon Sep 17 00:00:00 2001 From: ShemarG Date: Sun, 27 Sep 2020 13:03:16 +0000 Subject: [PATCH 1/2] Made some suggested improvements to README.md and bugfixes to helloWorld.js --- README.md | 14 +++++++------- helloworld.js | 14 ++++++++------ 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 7599585..0d44653 100644 --- a/README.md +++ b/README.md @@ -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 repositary. +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`. diff --git a/helloworld.js b/helloworld.js index e8a25b0..d93c6b4 100644 --- a/helloworld.js +++ b/helloworld.js @@ -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 :( +// Tried to invoke both functions here but I get an error :( helloWorld() -helloName("Ann") +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. From 00dcfb80aa0cf178bf2d5c426f2ac368d82a6056 Mon Sep 17 00:00:00 2001 From: ShemarG Date: Sun, 27 Sep 2020 13:13:09 +0000 Subject: [PATCH 2/2] Minor fixes that I missed on the first pass --- README.md | 4 ++-- helloworld.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 0d44653..6c3e546 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ This is an awesome JavaScript program that has interesting functions and feature ## helloWorld() -Logs the text 'Hello, World" to the console. +Logs the text "Hello, World" to the console. ## helloName(name) @@ -12,6 +12,6 @@ Takes an input string and then logs it as follows: "Hello, [string]", where [str ## Instructions -1. Fork this repositary. +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`. diff --git a/helloworld.js b/helloworld.js index d93c6b4..42783d9 100644 --- a/helloworld.js +++ b/helloworld.js @@ -7,7 +7,7 @@ function helloName(name){ } // 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") +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.