An warware: Maida kirtani zuwa ƙananan haruffa

Babban matsalar canza kirtani zuwa ƙananan haruffa shine yana iya haifar da canza wasu haruffa zuwa haruffa daban-daban. Wannan na iya haifar da matsala lokacin ƙoƙarin daidaita kirtani ko lokacin sarrafa bayanai.

var str = "Hello World!";

var res = str.toLowerCase();

Wannan lambar tana bayyana ma'anar kirtani da ake kira str kuma ta sanya masa darajar "Hello Duniya!". Sannan ya bayyana ma'anar ma'anar kirtani na biyu da ake kira res kuma ya sanya masa ƙimar str zuwa ƙananan haruffa.

Matsakaici

Mediana ɗakin karatu ne don ƙididdige matsakaicin saitin bayanai. An rubuta shi a cikin JavaScript kuma ana iya amfani dashi a kowace aikace-aikacen yanar gizo.

statistics

Ana sarrafa ƙididdiga a cikin JavaScript ta amfani da aikin Math.random(). Wannan aikin yana dawo da lambar bazuwar tsakanin 0 da 1. Kuna iya amfani da wannan lambar don samar da samfurin bazuwar, wanda zaku iya amfani dashi don yin zato game da yawan jama'a.

Shafi posts:

Leave a Comment