It's a horribly obscure way to do a type conversion.
! means NOT. So !true is false, and !false is true. !0 is true, and !1 is false.
So you're converting a value to a boolean, then inverting it, then inverting it again.
// Maximum Obscurity:
val.enabled = !!userId;
// Partial Obscurity:
val.enabled = (userId != 0) ? true : false;
// And finally, much easier to understand:
val.enabled = (userId != 0);
// Or just
val.enabled = Boolean(userId);
Note: the latter two expressions aren't exactly equivalent to the first expression when it comes to some edge case (when userId is [], for example), due to the way the != operator works and what values are considered truthy.