Giter Site home page Giter Site logo

chrisleboeuf / exit-study-guide-immerison-precourse Goto Github PK

View Code? Open in Web Editor NEW

This project forked from camilomontanez/exit-study-guide-immerison-precourse

0.0 1.0 0.0 16 KB

Study Guide for the Precourse Exit Test

JavaScript 90.87% HTML 9.13%

exit-study-guide-immerison-precourse's Introduction

Precourse Exit Practice

Requirements Pseudocode everything! Define your "IOCE"


Input: whatever data type your function accepts i.e (array of objects, string, object, array);

Output: data type that should be returned

Constraints: rules that your implementation must follow

Edge cases: special cases that could produce unintended results


Make all of your changes in exitPrep.js. Make sure to understand your constraints. A correct answer not following the constraints is wrong. It is better to have attempted the correct problem. Feel free to use the console and the debugger.

Manipulating Collections

  • Make 2 functions that randomize the order of an Array's contents. Implement one function that is pure (pureShuffle), and one that modifies the original array (dirtyShuffle).

  • Make a function mergeObjects that accepts an unspecified number of objects and updates the first object with the contents of all subsequent objects.

  • Make a function semiMergeObjects that performs the same operation as the previous function, but does not replace values at keys that are already present.

Recursion

Create a function replaceValuesInObj that finds all values of a provided name in an Object (and nested Objects) and renames them to a provided new name.

Example:

const obj = {
  golf: {
    zebra: 'charlie',
  },
};

replaceValuesInObj(obj, 'charlie', 'delta');

// returns { golf: { zebra: 'delta' } };

Create a function addKeysToExistingObj that adds a new key/value pair to an Object (and nested Objects).

Example:

const obj = {
  golf: {
    zebra: 'charlie'
  },
};

addKeysToExistingObj(obj, 'foxtrot', 'victor');
// {
//   golf: {
//     zebra: 'charlie',
//     foxtrot: 'victor'
//   },
//   foxtrot: 'victor'
// }

Executing Higher Order Functions

You are provided an Array of Objects representing SNL cast members.

Create a function comediansFilteredAndMapped that returns all the comedians that are:

  • cast members added from the year 2005 to present
  • cast members whose full name have more than 10 letters

It should:

  • Use filter and map
  • Make new keys (appearanceNumber, name, and seasonsActive)
  • Note: The values cannot be directly mapped to new keys

Do not create any unnecessary storage variables outside your Higher Order Functions. Your result should look like this:

[
  {
    appearanceNumber: '#8',
    name: 'Sterling K. Brown',
    seasonsActive: 6
  },
  {
    appearanceNumber: '#9',
    name: 'Jay Pharoah',
    seasonsActive: 7
  },
  {
    appearanceNumber: '#10',
    name: 'Leslie Jones',
    seasonsActive: 5
  }
]

Create a function comedianNamesFilteredAndMapped that gets the names of all the comedians that are:

  • cast members added from the year 2005 to present
  • cast members whose full name have more than 10 letters

It should:

  • Use filter and map

Create a function comediansReduced1 that represents all the comedians that are:

  • cast members added from the year 2005 to present
  • cast members whose full name have more than 10 letters

It should:

  • Use reduce
  • Make new keys (appearanceNumber, name, and seasonsActive)

Do not create any unnecessary storage variables outside your Higher Order Functions. Your result should look like this:

[
  {
    appearanceNumber: '#8',
    name: 'Sterling K. Brown',
    seasonsActive: 6
  },
  {
    appearanceNumber: '#9',
    name: 'Jay Pharoah',
    seasonsActive: 7
  },
  {
    appearanceNumber: '#10',
    name: 'Leslie Jones',
    seasonsActive: 5
  }
]

Create a function comediansReduced2 that represents all the comedian names that are:

  • cast members added from the year 2005 to present
  • cast members whose full name have more than 10 letters

It should:

  • Must use reduce

exit-study-guide-immerison-precourse's People

Contributors

asp2131 avatar harveysanders avatar jaykindell avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.