Git Product home page Git Product logo

group-ex-js-may-05's Introduction

Define a function called actionCallback, that converts jsonData object to regular js object. It returns the result from JSON.parse().

Extract the list of numbers inside this object's "data" property, in a new variable.

Create a class DataProcess. In this class: Create a constructor that takes this list of numbers, and stores it in this._data;

Create a method called sortData which sorts all the elements in this._data, and updates this._data to be sorted.

Create a method called calculateTotal, which calculates a total for this array, and saves it in this.total;

Create a method called isEven, which will be true if the total is even, or false if the total is odd.

Create a method called doDouble, which doubles all the elements in our data using .map(), and stores it into this.doubled.

Create a static method called getOdd, which gets all the odd elements in our data, and returns them.

Create a static method called getEven, which gets all the even elements in our data, and returns them.

Create a method which prints all these properties we created previously, this.total, this.doubled, this._data.

Create a method which filters all the elements smaller than 50, and stores them into this.smaller.

Create the method toJSON() which returns the class properties we want to stringify, in an object like: {data: this._data}. Convert our ProcessData object to json, and print it.

group-ex-js-may-05's People

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.