Global regular expressions (those that use the flag g) are special. If you call them on the same line multiple times, they look for consecutive matches. Since your test string contains exactly two matches for null, the third call RegExp#testreturns false(the third match in the string cannot be found).
, g :
var re = /null/
console.log(re.test('null null'))
console.log(re.test('null null'))
console.log(re.test('null null'))