I found this version most suitable for all cases. It doesn't remove all whitespaces.
For example "a (test) b" -> "a b"
"Hello, this is Mike (example)".replace(/ *\([^)]*\) */g, " ").trim();
"Hello, this is (example) Mike ".replace(/ *\([^)]*\) */g, " ").trim();