King_Izie👑 pfp
King_Izie👑
@iziedking
This new JavaScript operator is an absolute game changer! JavaScript is about to make async code a whole lot cleaner with the new ?= operator. It helps avoid deep nesting and bulky try-catch blocks, making code easier to understand and maintain. The ?= operator, known as the Safe Assignment operator, was introduced as a proposal in the ECMAScript community in 2024. Here is how it works: The ?= operator allows functions to return a tuple [error, result]. • If an error occurs during function execution, it returns [error, null]. • If the function runs successfully, it returns [null, result]. The ?= safe assignment operator is currently a proposal and not yet part of the official ECMAScript specification. However, you can still play around with it through polyfills, with a few limitations, like needing to use = in place of the actual ?= operator. Developers are also encouraged to contribute to its development.
1 reply
0 recast
4 reactions

Pinnoche pfp
Pinnoche
@pinnoche
Is it really new 🤔
1 reply
0 recast
0 reaction

King_Izie👑 pfp
King_Izie👑
@iziedking
😆😆not really… it’s not even in use a better syntax would be described soon
1 reply
0 recast
0 reaction

Pinnoche pfp
Pinnoche
@pinnoche
Then I'd say Axios is better than fetchUrl as it does some task automatically already and is more security conscious
1 reply
0 recast
0 reaction

King_Izie👑 pfp
King_Izie👑
@iziedking
Haha… of course fetch requires more advance usage compared to axios that does all d work for you
1 reply
0 recast
0 reaction

Pinnoche pfp
Pinnoche
@pinnoche
So which would you have preferred..
1 reply
0 recast
0 reaction

King_Izie👑 pfp
King_Izie👑
@iziedking
Axios is always d choice 😂 Na people wey like hard things go Dey accustom to fetch
0 reply
0 recast
0 reaction