Q:

In Grunt, what's the difference between **.js vs **/*.js?

I've seen both **.js and **/*.js in some open source projects. As I understand it, **/*.js targets all .js files in all folders recursively.
Then, what does **.js mean? Does it mean the same thing as **/*.js or *.js or something else?

A:

The ** is the so-called globstar and it works the same as in bash: It matches directories recursively. The documentation of the minimatch library (which Grunt uses internally) states:

  This is supported in the manner of bsdglob and bash 4.1, where ** only has special significance if it is the only thing in a path part. That is, a/**/b will match a/x/y/b, but a/**b will not.

In other words, **.js means the same as *.js.

