Skip to content

Instantly share code, notes, and snippets.

View GermanHoyos's full-sized avatar
😋
Coding!

German Adrian Hoyos GermanHoyos

😋
Coding!
View GitHub Profile
@GermanHoyos
GermanHoyos / player-js-analysis.md
Last active December 13, 2017 23:34 — forked from R-V-S/player-js-analysis.md
player.js analysis
  1. This file declares a class, Player, instantiates it, and assigns it to a global player variable.
  2. The Player class contains four methods:
    • constructor()
    • playPause()
    • skipTo()
    • setVolume()
  3. The constructor() method sets initial values for the currentlyPlaying, playState, volume, and soundObject properties.
    • currentlyPlaying is set to the first item in album.songs.
    • The initial playState is "stopped".
  • The volume is set to the number 80.
@GermanHoyos
GermanHoyos / Each With Index
Created March 4, 2018 00:04 — forked from PamBWillenz/Each With Index
Loops - Bloc Checkpoint
INSTRUCTIONS
[2,4,6].each_with_index do |element, index|
p "#{element} is at position #{index}"
end
Write a method, add_value_and_index, that takes an array of numbers and returns a new array composed of the value-plus-the-index of each element in the argument array:
add_value_and_index([2,4,6])
#=> 2,5,8
SPECS