카타 8급 Yield to the Block

1 개요[ | ]

카타 8급 C
# 🔗 문제 풀이

틀:카타 8급-2

2 Ruby[ | ]

def compute
  block_given? ? yield : "Do not compute" 
end
def compute
  yield rescue "Do not compute"
end
def compute
  if block_given?
    yield
  else
    return "Do not compute"  
  end
end
문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}