Code works in function, but not in a Change Node?

Please edit your message to include your flow
snippet between three backticks using the code block icon </>. See How to share code or flow json. Otherwise it cannot be imported.