Code Golf

Is this reality, or are we really living in a computer simulation?

The Challenge

Your task is to input a string, and output the number of spaces in the string.

This is Code Golf, so least number of bytes win.

Test Cases

"test" => 0
"Hello, World!" => 1
"C O D E G O L F" => 7
"      " => 6

The Solution (click here)

function c(m) {
return m.replace(/[^ ]/g,”).length;