I'm trying to convert some complex C# bitshifting code into javascript (node), but I'm having issues with this kind of conversion as an example:
var d = false;
var k = 61;
var dd = 103;
uint r = 2924539136;
r |= unchecked((byte)(d ? (k + dd) : (k - dd)));
Console.WriteLine("result: " + r); // 2924539350
Is there some way to replicate the (byte) casting in javascript to where it computes the value I'm looking for, I have this so far, but it just results in -42.
r |= (d ? (k + dd): (k - dd));