vendredi 4 juin 2021

How can I improve this custom element code?

A junior developer here.

I wrote a simple javascript custom element code here: https://codepen.io/rndbox/pen/mdWxryw as clean as I could with some advice from Junior Vs Senior Code - How To Write Better Code.

If possible, I would appreciate, if any willing Javascript Senior developer could improve / re-write my code in a more "pro" style so I can use his/her version as a reference/guideline on: better naming variables,better comment, use design pattern (if any), how to validate properly, check errors etc..

Also is there a way to pass props from tag like bellow?

<custom-element options="{}"></custom-element>

Thanks very much!

Ps: the code is in english although french is my native language.

Aucun commentaire:

Enregistrer un commentaire