Question: I have a table Foo

id 

```
1 
2 
3 
4 
5

```

i have a table Bar

```
foo_id = 1 test = 1
foo_id = 2 test = 0
foo_id = 4 test = 1
foo_id = 5 test = 1

```

I want to retrieve id from foo where bar test = 0 or not exist in bar.

I have

```
$id = Foo::with('bar')->whereHas('bar', function ($q)
  {$q->where('test', '=', 0)
  ->orWhereNull(foo_id???????);})
->get();

```

How can i write this down?

Answer: 
JavaScript doesn't have `int` and `short` and such, it has `number`, which is an IEEE-754 double-precision binary floating point type (and typed arrays as in [Patrick Roberts' answer](https://stackoverflow.com/a/50179301/157247)). However, for certain operations, it acts like it has a 32-bit integer type.

You could take your number and use bit shifting operators to lose half of that 32-bit value, like this:

```js
var a = 65512;
a = (a << 16) >> 16;
console.log(a);
```
JavaScript does not support variable types such as short.
You'll have to handle ensuring the number is in short on the server side and keep it as a string in the JavaScript side.