Skip to content

Instantly share code, notes, and snippets.

View njolipatrick's full-sized avatar
🎯
Focusing

Njoli Patrick njolipatrick

🎯
Focusing
View GitHub Profile
const objectName = {
name: 'test',
age: 21,
country: 'Earth'
};
// expected output: // "name: test" // "age: 21"
let obj = function(o){
for(var object in o){
return('name:' + o.name + ' age:' + o.age + ' ' + 'country:' + o.country);
@njolipatrick
njolipatrick / README.md
Created November 9, 2021 11:57 — forked from andreasonny83/README.md
Readme template

npm version code style: prettier

Project Name

Write a project description

Prerequisites

This project requires NodeJS (version 8 or later) and NPM.

/*
* Programming Quiz: Umbrella
*/
/*
* QUIZ REQUIREMENTS
* - Your code should have a variable `umbrella`
* - The variable `umbrella` should be an object
* - Your `umbrella` object should have the `color` and `isOpen` property
* - Your `umbrella` object should have an `open()` method that toggles the value of `isOpen` property
* - Your `umbrella` object should have an `close()` method that toggles the value of `isOpen`
/*
* Programming Quiz: Laugh it Off 1
*/
/*
* QUIZ REQUIREMENTS
* - Your code should have a `laugh()` function
* - Your `laugh()` function should return the correct output
* - Your code should print `\"hahahahahahahahahaha!\"` by calling the `laugh()` function inside `console.log()`
* - BE CAREFUL ABOUT THE PUNCTUATION AND THE EXACT WORDS TO BE PRINTED.
/*
* Programming Quiz: Software Engineering Students
*/
/*
* QUIZ REQUIREMENTS
* - Your code should have a variable `softwareEngineeringStudents`
* - The variable `softwareEngineeringStudents` should be an array containing the values of 10 students from your class
* - Your code should print `softwareEngineeringStudents` to the console
*
/*
* Programming Quiz
*/
/*
* QUIZ REQUIREMENTS
* - Your code should have a variable `x` with a starting value of `1`
* - Your code should include a `while` loop
* - Your `while` loop should have a stop condition
* - Your code should use a conditional statement
* - Your code should increment `x` by `1` each time the loop executes
/*
* Programming Quiz: Even or Odd
*
* Write an if...else statement that prints `even` if the
* number is even and prints `odd` if the number is odd.
*
* Note - make sure to print only the string "even" or the string "odd"
*/
/*
* QUIZ REQUIREMENTS
/*
* Programming Quiz: Converting Temperatures
*
* The Celsius-to-Fahrenheit formula:
*
* F = C x 1.8 + 32
*
* 1. Set the fahrenheit variable to the correct value using the celsius variable and the forumla above
* 2. Log the fahrenheit variable to the console
*
@njolipatrick
njolipatrick / Git Basic Exercises
Created September 8, 2021 11:21
Git Basic Exercises
<!-- Now that you have learned the basics of Git workflow, try running through this a couple of times on your own:
Create a folder called learn_git_again. -->
`mkdir learn_git_again`
<!-- cd into the learn_git_again folder. -->
`cd learn_git_again`
@njolipatrick
njolipatrick / Intermediate Terminal Exercises
Created September 7, 2021 18:45
Intermediate Terminal Exercises
<!-- Part I
Answer the following questions:
Create an environment variable called FIRST_NAME and set it equal to your first name (this does not need to be permanent) -->
`export $FIRST_NAME=TIMOTHY`
<!-- Print the FIRST_NAME variable -->
`echo $FIRST_NAME`