Filter, Map, Reduce, CompactMap, FlatMap - Swift - iOS Dev Interview Questions

Поділитися
Вставка
  • Опубліковано 20 гру 2024

КОМЕНТАРІ • 35

  • @DaveDDD
    @DaveDDD Рік тому +6

    The way you explained trailing closures in this made something finally click in my brain! I have no idea how it was able to confuse me for so long - it’s just so simple. Thank you!

    • @seanallen
      @seanallen  Рік тому +3

      I remember that feeling! Happy to help.

  • @sergiovinhal5934
    @sergiovinhal5934 3 місяці тому +2

    Excellent video . Thank you Sean .

    • @seanallen
      @seanallen  3 місяці тому

      Glad you enjoyed it

  • @Spacer-l3j
    @Spacer-l3j 9 місяців тому +1

    Finally this video clicked for me... Simple examples makes you understand... i have watched 3 other videos across UA-cam to understand high order functions but they had stupid azz examples i couldn't understand a freking thing...

    • @seanallen
      @seanallen  9 місяців тому

      Glad it finally clicked!

  • @mahmoudhashim3720
    @mahmoudhashim3720 Рік тому

    Big Love Sean, THANK YOU, you and Afraz are the best

  • @Rayana_rei
    @Rayana_rei Рік тому

    smart explanation, clear language! very efficient.. very.. ! 👏🏻

  • @ANILAVCI
    @ANILAVCI Рік тому

    Thanks for the shares. You have many followers from Turkey. Even though I watch with automatic subtitles, I learn a lot.

  • @kavinda_dilshan_paramsoodi
    @kavinda_dilshan_paramsoodi Рік тому

    Never knew about a reduce, just learned it today. Thanks, sean. I've been doing it the hard way all this time.

  • @tylerwatt5651
    @tylerwatt5651 Рік тому

    Thank you so much for putting this together! Especially for map and reduce!

  • @ellen_kapii
    @ellen_kapii Рік тому +2

    Excellent explanation, as usual. Thank you!

  • @tigran.zakaryan
    @tigran.zakaryan Рік тому

    thank you!

  • @JasonMitchellAZ
    @JasonMitchellAZ Рік тому

    Great explanations for these

  • @gakkieNL
    @gakkieNL Рік тому +2

    You can use keypaths with these high level functions. Makes for great readability!

  • @soheilpakgohar6630
    @soheilpakgohar6630 Рік тому

    Great job Sean, before this I really got stuck which one is

  • @ahmednemo5954
    @ahmednemo5954 Рік тому +1

    Amazing you are the best,Thanks for being one of the best is swift 👍

    • @seanallen
      @seanallen  Рік тому

      Thanks for the kind words, Ahmed.

  • @milanfdl1968
    @milanfdl1968 Рік тому

    Cool video. Learned some new things today. Thank you!

  • @viniciushenriquepellegrini3534

    Amazing !

  • @bosch5053
    @bosch5053 Рік тому +1

    Thanks

  • @xfabiosoft
    @xfabiosoft Рік тому

    How about Zip? How does it work and when is useful?

  • @paulcristo
    @paulcristo 10 місяців тому +1

    Thanks.

  • @filipchwastowski4228
    @filipchwastowski4228 Рік тому +2

    cool vid, but I believe that $0 and $1 when reducing does not refer to "this and next iteration", but to "current result and current iteration" - isn't that right? :) because here you keep handling constantly "accumulating current result" with each collection's element.

    • @Jacob-rm7vo
      @Jacob-rm7vo Рік тому +1

      Yes that is how I understood reduce, even in other languages. It would accumulate - add the first and second, then add the third to that value. I think of $0 meaning lhs (left hand side) and $1 rhs

    • @joshuascorca550
      @joshuascorca550 Рік тому

      @@Jacob-rm7vo exactly. Filter iterates through the array, doing this:
      sumSoFar += object.numberToAdd
      So $0 is the lhs, and $1 is the object on the rhs. This is why Sean needs to write $1.users and not $0.users. $0 is an Int already.

  • @filipecanzi
    @filipecanzi Рік тому

    Thanks Sean!!

  • @Patrick462
    @Patrick462 Рік тому +1

    Great explanations, really appreciate it.
    A few reactions if you're open to such things:
    1. Using Double for currency values will work 99.99% of the time. It's that .01% that will drive you crazy.
    2. I wouldn't use the for loop as a tool to explain filter/map/reduce. Your original explanation is great and more than sufficient. Adding discussion of the for loop way of calculating will confuse a certain percent of viewers, and slow down almost everyone.

    • @mario_luis_dev
      @mario_luis_dev Рік тому +2

      I disagree. He’s right in bringing up the for loop for comparisons, since that is the whole point on declarative programming: streamline the uglier, more verbose imperative style

  • @mkhasson97
    @mkhasson97 Рік тому

    Awesome 🎉
    Is there any plan for portfolio review? I’d love to hear your opinion about my website.
    Thank you in advance 😊

  • @MegaOlzo
    @MegaOlzo Рік тому

    Thanks!)

  • @victorriurean
    @victorriurean Рік тому

    nice

  • @guitaripod
    @guitaripod Рік тому

    69th like