As already pointed out, these are not the same. Javascript based custom functions in Google Sheets are actually really error prone, meaning that they will just _randomly fail to execute_. Cells will be stuck with a "loading..." message until you trick Sheets into recalculating the value. In the next couple months, I'll likely be ripping out as many custom functions as I can.
And these are not for particularly complicated functions.
I'd really love to have this feature in Sheets. It would simplify a lot of what my sheets do, and also make it more accessible to a Sheets power user that gets scared off from code.