Skip to content
Open
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
21 changes: 11 additions & 10 deletions src/js-functions-1.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,39 +2,40 @@ const shouldRunMain = process.argv[3];

// expects no argument
// example usage: hello()
// expected output: console logs "Hello World!"
// expected output: prints "Hello World!"
// expected return: undefined
const hello = () => {
// fill in this function
console.log('Hello World!');
};

// expects a string argument
// example usage: helloString("Bye!")
// expected output: console logs "Bye!"
// expected output: prints "Bye!"
// expected return: undefined
const helloString = inputString => {
const helloString = (inputString) => {
// fill in this function
};

// expects an array of strings argument
// example usage: helloString(["Bye!", "Hi!"])
// expected output: console logs "Bye!" and then console logs "Hi!"
// expected output: prints "Bye!" and then prints "Hi!"
// expected return: undefined
const helloArray = inputArray => {
const helloArray = (inputArray) => {
// fill in this function
};

// expects an object with key "message" argument
// example usage: helloString({message: "Hello"})
// expected output: console logs "Hello World!"
// expected output: prints "Hello World!"
// expected return: undefined
const helloObject = inputObject => {
const helloObject = (inputObject) => {
// fill in this function
};

// expects 3 arguments
// example usage: helloString("Hello", "World", "!")
// expected output: console logs "Hello World!"
// expected output: prints "Hello World !"
// expected return: undefined
const helloArguments = (argumentOne, argumentTwo, argumentThree) => {
// fill in this function
Expand All @@ -47,10 +48,10 @@ const helloArguments = (argumentOne, argumentTwo, argumentThree) => {

console.log('Starting Main');
hello();
helloString(''); // replace arguments
helloString(); // replace arguments
helloArray([]); // replace arguments
helloObject({}); // replace arguments
helloArguments('', '', ''); // replace argumentss
helloArguments('', '', ''); // replace arguments
})();

module.exports = {
Expand Down