It is used to toggle between the fadeIn() and fadeOut() functions. Here is an example to show the same:
<div id="div1" style="color:orange;”>My text</div>
<button>fade in/out</button><br><br>
<script>
$("button").click(function(){
$("#div1").fadeToggle();
}
</script>