What is && operator perform?

Hi,

What is && doing in the following code?

@_current_user ||= session[:current_user_id] && User.find_by(id:
session[:current_user_id])

It’s “and”, you can see better this way:

@_current_user ||= (session[:current_user_id]) && (User.find_by(id:
session[:current_user_id]))

There are two conditions, if both return true then the assignation
happens only if @_current_user is nil.