:vimgrep string filetype

You can use vimgrep to search for a strip within a filetype.
:vimgrep foo *.js - will search for foo in all js files within the current directory.
All matches will be loaded into a quickfix list that you can quickly cycle through. To move your cursor to the next match in the list use :cn. To move back use :cp. To open the list use :copen and to close the list use :cclose.

Further Reading

:h :vimgrep :h quickfix

More Gifs