Skip to content

marxtin/dci_js_exercise_solutions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

72 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dci_js_exercise_solutions

the contents of this repository

1. solutions to exercises from our course

  • they start wit 03_pb_

  • pb_assessment_16_11_21:

    Assessment Test of 16.11.2021 --> my solutions with explanations for the tougher tasks

  • pb_assessment_17_12_21 Assessment Test* of 17.12.21 --> my revised solutions (they passed all tests)

1.2. official solutions by Sebastian

  • seb_sol_objects-practice-4
  • seb_sol_callbacks-practice

2. "my" class/tutorium code, exercises and solutions (sometimes with explanations)

in alphabetical order

  1. Bubble Sort

    • algorithm with:
    • do...while
    • sort() array method
  2. Check for character in string functions

    • 5 different ways
    • arrow-functions
    • just true/false or
    • print sentence
    • for-loop, if-condition
    • includes()
  3. calculator

    • with object constructor function
  4. check function for word , number

    • logical & comparison operators (including !)
    • isNaN functions
  5. check even or odd

    • one number
    • numbers 0 to n
    • ternary ? :
    • mod
  6. Dice function

    • adjustible dice roll, for dice with variable number of sides
    • closure
  7. endsWith

    • another answer for afternoon exercise 1 01.12.2021
  8. fibonacci sequence function

    • for-loop
    • array.push()
    • recursion new
  9. filter

    • includes exercise 1 afternoon 01.12.2021
    • filter array of strings by first char of string
  10. first letter uppercase function (each word in string)

    • toUpperCase ()
    • split(), charAt(), push(), slice(), join()
    • with for...of
    • with forEach
  11. Fisher Yates Algorithm

    • random shuffle elements in array
  12. fizzbuzz - function

    • for-loop, else-if
    • logical and comparison operators
  13. forEach

    • vowel counter in string with fallback assignment
  14. geometric sequence function

    • for-loop
    • Math.pow()
  15. get_num_array_objects_property_value

    • count instances of property value from objects in array
    • reduce()
    • ternary
  16. ladder -object with method-chaining

  17. largest number in array and largest sub-array functions

    • for-loop
    • if-statement
    • Math.max()
    • spread operator ...
  18. map

    • show first and last character in array of strings
  19. multi-dimensional array multiplication function

    • nested for loop (2 loops)
    • multiplication assignment operator
  20. Palindrome 1.

    • for-loop
    • if-statement
  21. Random number

    • between min & max
    • get a random number (e.g. useful for games)
  22. reduce

    • examples from 01.12.2021
  23. reverse number function

    • string methods split(), reverse(), join()
    • number constructor Number()
  24. sort stuff

    • alphabetically, digits 0-9
    • nested loop
    • split(),join()
    • sort()
  25. scramble words

    • from Mock exam advanced PB by James
    • Fisher Yates Algorithm
    • array methods
    • includes()
  26. sum of multiples functions

    • with one and three arguments
    • modulo, logical + comparison operators
    • for-loop, if-condition

About

javascript exercises by martin

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors