Coder Social home page Coder Social logo

glints-test-fundamental's Introduction

case_one.js

For each of the exercises below, assume you are starting with the following people array.

let people = ["Greg", "Mary", "Devon", "James"];

  • Using a loop, iterate through this array and console.log all of the people.
  • Write the function to remove "Greg" from the array.
  • Write the function to remove "James" from the array.
  • Write the function to add "Matt" to the front of the array.
  • Write the function to add your name to the end of the array.
  • Write the function Using a loop, iterate through this array and after console.log-ing "Mary", exit from the loop.
  • Write the function to make a copy of the array using slice. The copy should NOT include "Mary" or "Matt".
  • Write the function that gives the indexOf where "Mary" is located.
  • Write the function that gives the indexOf where "Foo" is located (this should return -1).
  • Redefine the people variable with the value you started with. Using the splice function, remove "Devon" from the array and add "Elizabeth" and "Artie". Your array should look like this when you are done ["Greg", "Mary", "Elizabeth", "Artie", "James"]. Create a new variable called withBob and set it equal to the people array concatenated with the string of "Bob".

case_two.js

I have 2 array

let number = [1, 2, 3]; let char = ["a", "b", "c"];

  • Write the function to combine all array like ["a", 1, "b", 2, "c"] with built in function.

What about 2 object or more ? const objA = { a: 10, b: 20, c: 30 } const objB = { a: 3, c: 6, d: 3 }

  • Write the function to combine all object like { a: 13, b: 20, c: 36, d: 3 }.

case_three.js

Count each of these words: aku, ingin and dapat. Output in object data. { aku : 1, ingin : 1, dapat : 1 }

Aku ingin begini
Aku ingin begitu
Ingin ini itu banyak sekali

Semua semua semua
Dapat dikabulkan
Dapat dikabulkan
Dengan kantong ajaib

Aku ingin terbang bebas
Di angkasa
Hei… baling baling bambu

La... la... la...
Aku sayang sekali
Doraemon

La... la... la...
Aku sayang sekali

glints-test-fundamental's People

Contributors

andikas95-dev avatar frdnth 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.