I came across this piece of code that I'm testing to determine if a file added to a canvas is an image. I'm curious about the functionality behind it. Just to clarify, "file" refers to a FileList obtained from an input element.
if (/^image\/\w+/.test(file.type))