Babban matsalar maye gurbin duk sarari da harafi ษaya shine yana iya haifar da matsala lokacin da aka kwafi da liฦa rubutu.
with underscore var str = "javascript replace all space with underscore"; str = str.replace(/ /g, "_");
Wannan layin lambar yana maye gurbin duk sarari a cikin kirtani "javascript maye gurbin duk sararin samaniya tare da ฦaranci" tare da ฦararrawa.
Sauya a javascript
Sauya aiki ne a cikin JavaScript wanda ke ษaukar gardama biyu. Hujja ta farko ita ce zaren da za a maye gurbinsa kuma hujja ta biyu ita ce zaren maye.
Yin aiki tare da maye gurbin da rubutu
A cikin JavaScript, zaku iya amfani da ayyukan maye gurbin () da ayyukan rubutu () don maye gurbin rubutu a cikin kirtani.
Ayyukan maye gurbin () yana maye gurbin duk abin da ya faru na kirtani a cikin kirtani tare da wani kirtani. Aikin rubutu() yana mayar da rubutun kirtani, ba tare da wani tsari ba.