regex JavaScript – Match exact string from multiple words

I need a regex to match “aba” from a string like “aba abab”.

var r = /^aba$/ doesn’t work because it doesn’t match strings with multiple words.

r.test(“aba abab”); // should match only “aba”