SharonInfante / songs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

🎼 ECMAScript 6 Exercises

Table of Contents

  1. General Info
  2. Requirements
  3. Installation and run tests
  4. Exercises

General Info

This is an exercise for practice ECMAScript 6 features like map, filter, reduce, sort and ternary operators (It's mandatory to use them to manipulate arrays) for, forEach and if/else it's not allowed .It has empty functions that you should complete and run the tests, you can add parameters. It has a data file that contains songs information and your goal is to pass all tests, you don't have to show anything on the screen.

Requirements

Fork this repo into your Github account.

Installation and run tests

  • npm install
  • npm test

Use the tests/songs.test.js file to know exactly what you are asked to do but don't modify that file. Write your code in the src/song.js file.

Exercises

  • Exercise 1: funtion getAllArtists() -> write the code that gets all artists into an array.
  • Exercise 2: funtion getSongsFromArtist() -> return the objects that contains the song of a certain artist.
  • Exercise 3: funtion orderAlphabetically() -> alphabetic order the array by title.
  • Exercise 4: funtion orderByYear() -> order the array by year, ascending.
  • Exercise 5: funtion songsByGenre() -> filter songs by a certain genre.
  • Exercise 6: funtion minutsToSeconds() -> modify the duration of songs to seconds.
  • Exercise 7: funtion getLongestSong() -> get the longest song.
  • Exercise 8: function getShortestSong() -> get the shortest song. Write the test and function.

🎼 Ejercicios de ECMAScript 6

Tabla de Contenidos

  1. Información General
  2. Requerimientos
  3. Instalación y tests
  4. Ejercicios

Información General

Este es un ejercicio para practicar las funcionalidades de ECMAScript 6 tales como map, filter, reduce, sort y condicionales ternarios (Su uso es obligatorio para manipular los arrays) las funcionalidades de for, forEach y if/else no están permitidas. Las funciones ya están declaradas y se deberá añadir el código y pasar los tests, está permitido añadir parámetros si se necesita. Existe un archivo deta.js que contiene un array de objetos con canciones y el objetivo del ejercicio es pasar todos los tests. No es necesario mostrar nada en pantalla.

Requerimientos

Hacer un fork de este repositorio en tu cuenta de Github.

Installation y tests

  • npm install
  • npm test

Clona tu repo en tu visual studio code e instala node (npm install), corre los tests (npm test) para mirar lo que está fallando. Usa el archivo tests/songs.test.js para saber exactamente lo que se te pide pero no puedes modificar este archivo. Escribe tu código en el archivo src/song.js file.

Ejercicios

  • Ejercicio 1: función getAllArtists() -> escribe el código para obtener un array solo de artistas.
  • Ejercicio 2: función getSongsFromArtist() -> retorna todo el objeto que contiene las canciones de un artista determinado.
  • Ejercicio 3: función orderAlphabetically() -> ordena el array por título alfabéticamente.
  • Ejercicio 4: función orderByYear() -> ordena el array por año en orden ascendente.
  • Ejercicio 5: función songsByGenre() -> filtra las canciones por género determinado.
  • Ejercicio 6: función minutsToSeconds() -> modifica la duración de las canciones a segundos.
  • Ejercicio 7: función getLongestSong() -> obtiene la canción con mayor duración en segundos.
  • Ejercicio 8: función getShortestSong() -> obtiene la canción con menor duración en segundos. Escribe el test y la función.

About


Languages

Language:JavaScript 99.3%Language:HTML 0.7%