The first question was why anyone would write a shader in javascript, then it turned out it wasn't actually shaders written in javascript. Now you're telling me you can again, but the question is still why.
The first example was a js shader too but because it also included glsl it could have been easy to miss that. So the second example just emphasizes that better. Regarding why, see my first answer or feel free to browse the thousands of other examples on the site!
Why do you keep calling these shaders? Javascript isn't running on the GPU and it isn't doing any rendering. If making SDF data is called a shader, all scene setup is not and geometry creation would be the same.
Again, just passing around a javascript function doesn't mean it's a shader. Javascript isn't running the GPU and javascript isn't doing any rendering.