Why does my array sort order changes when I pass it to JS using WP_REST_Response?

Fix by using:

return new \WP_REST_Response( \json_encode( $return_data), 200 );

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)