i want two make compare in foreach loop to compare if value of branch from jquery equal to value from foreach then selected it

I have a select and get value from jquery and want to compare it with value in foreach if two value id is similar then active the selected value how can i do this this is the foreach in blade:

i want two make compare in foreach loop to compare if value of branch from jquery equal to value from foreach then selected it

<select name="branch">
@foreach($branchs as $branch)
    <option value="{{$branch->id}}">{{$branch->title}} 
    </option>                                              
@endforeach
</select>

$.ajax({
url:getHref,
data:{id:id},
}).done(function(data) {
$.each(data, function(index,employee){
$( “input[name*=’name’]” ).val(employee.name );
$( “select[name=’branch’]”).val(employee.branch_id);
$( “select[name=’role_id’]” ).val(employee.role_id);
});
});
});