Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function wisePerson(wiseType, whatToSay) {
- // your code here
- return `A wise ${wiseType} once said: "${whatToSay}".`;
- /*return `A wise ${wiseType} once said: "${whatToSay}".`; (with and without ()*/
- /*console.log('A wise ' + wiseType + ' once said: ' + '"' + whatToSay +'"' + '.'); WORKS IN DEV TOOLS CONSOLE BUT NOT IN REPL CONSOLE**/
- }
- console.log(wisePerson('goat', 'Hello World'));
- /* From here down, you are not expected to
- understand.... for now :)
- Nothing to see here!
- */
- // tests
- function testWisePerson() {
- const wiseType = 'goat';
- const whatToSay = 'hello world';
- const expected = 'A wise ' + wiseType + ' once said: "' + whatToSay + '".';
- const actual = wisePerson(wiseType, whatToSay);
- if (expected === actual) {
- console.log('SUCCESS: `wisePerson` is working');
- } else {
- console.log('FAILURE: `wisePerson` is not working');
- }
- }
- testWisePerson();
Add Comment
Please, Sign In to add comment