top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

In Scala What is difference between for loop, for with Guard, for with Yield?

+1 vote
475 views
In Scala What is difference between for loop, for with Guard, for with Yield?
posted Nov 22, 2016 by Shyam

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+1 vote

Simple for loop iterates over a collection, translated to foreach method.

for with yield translated to a withFilter followed by map method.

It searches for specified value and return Int.

answer Nov 23, 2016 by Karthick.c
...