If you're using this code snippet as a reference, keep in mind that there may be other issues to address. Make sure you have all the necessary CSS code for dropdown functionality.
Simply adding classes without understanding how Bootstrap 4 works can lead to future problems. Take the time to learn how flex works, especially when nesting <div>
elements with classes.
Check out these resources to better understand flex:
https://www.w3schools.com/bootstrap4/bootstrap_flex.asp
https://getbootstrap.com/docs/4.3/utilities/flex/
By mastering flex in Bootstrap 4, your coding experience will be much smoother. Happy coding!
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
<div class="d-flex justify-content-between" style="background:black">
<div></div>
<div>
<h2 class="text-center" style="color:white">Resultado de aprendizaje A</h2>
</div>
<div class="dropdown mr-3">
<button class="btn btn-outline-light" type="button" id="dropdownMenu2" data-toggle="dropdown"
aria-haspopup="true" aria-expanded="false">
<i class="fa fa-ellipsis-h p-1" style="font-size: 18px"></i>
</button>
<div class="dropdown-menu" aria-labelledby="dropdownMenu2">
<a class="dropdown-item" data-toggle="modal" data-target="#resultadoModal}edit">Editar</a>
<button class="dropdown-item" >
Eliminar
</button>
</div>
</div>
</div>