DevOps Articles

Curated articles, resources, tips and trends from the DevOps World.

7 Uses of Underscore in Scala

4 years ago dzone.com
7 Uses of Underscore in Scala

Summary: This is a summary of an article originally published by the source. Read the full original article here →

by In this article I'll share almost all the places where you might see an underscore, so that you don't freak out when you see yet another one in a different context. You can also read this article over at the Rock the JVM blog or watch the video version of it on YouTube or embedded below: Other than that, I want to get straight to the point.

However, the case when the compiler throws a value at use, but we don't use it, so we use an underscore.

One of them is importing everything in a package: But by far the most frequent use case is in pattern matching, where the underscore means "match everything".

Made with pure grit © 2024 Jetpack Labs Inc. All rights reserved. www.jetpacklabs.com