Giter Site home page Giter Site logo

funthingsforfunreasons's Introduction

Precourse Exit Practice

Requirements Pseudocode everything! Define your "IOCE" Do not alter any provided function definitions 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

Manipulating Collections

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

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

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

Recursion

Find all values of a provided name in an Object (and nested Objects) and rename them to a provided new name.

Example:

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

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

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

Add a new key/value pair to an Object (and nested Objects).

Example:

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

addKeysToExistingObj(obj, 'foxtrot', 'victor');

// returns { golf: { zebra: 'charlie', foxtrot: 'victor' }, foxtrot: 'victor' };

Executing Higher Order Functions

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

Create altered data sets for the following conditions:

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

Make new keys (appearanceNumber, name, and seasonsActive).

Note: The values cannot be directly mapped to new keys

Check provided result below for new data examples. Implement each solution in two ways:

  • Chaining native methods or other functions
  • Using the native method of reduce

Constraints:

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

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

funthingsforfunreasons's People

Contributors

jaykindell avatar

Watchers

James Cloos 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.