Babban matsalar da ke da alaƙa da gano maɓallin guduwa ita ce ana iya danna shi cikin sauƙi ta hanyar haɗari. Idan wani ya danna maɓallin tserewa bisa kuskure, zai iya haifar da matsala a cikin kwamfutar.
var escapeKeyCode = 27; document.onkeydown = function(evt) { evt = evt || window.event; if (evt.keyCode == escapeKeyCode) { alert('Escape key was pressed.'); } };
Wannan lambar tana bayyana aikin da za a aiwatar a duk lokacin da aka danna maɓalli. Idan maɓallin da aka danna yana da lambar maɓalli na 27, to, faɗakarwa za ta tashi yana cewa 'An danna maɓallin Tserewa'.
Abubuwa da azuzuwan
A cikin JavaScript, abubuwa hanya ce ta haɗa bayanai masu alaƙa tare. Azuzuwan hanya ce ta haɗa lambobin alaƙa tare.
Abu misali ne na aji. Ajin samfuri ne don ƙirƙirar abubuwa. Kuna ƙirƙirar abu ta amfani da sabuwar kalmar maɓalli da ƙididdige sunan ajin. Misali, zaku iya ƙirƙirar abu mai suna “Mutum” ta amfani da lambar da ke gaba:
var mutum = sabon mutum ();
Hakanan zaka iya ƙirƙirar abu ta amfani da aikin ginin da aka ayyana a cikin aji. Misali, zaku iya ƙirƙirar abu mai suna “Student” ta amfani da lambar da ke biyowa:
var dalibi = sabon Student();
Python Object Oriented
Python yaren shirye-shirye ne da ya dace da abu wanda ke ba masu haɓaka damar ƙirƙirar ƙa'idodin software na zamani cikin sauƙi. Python ya shahara don karantawa da fahimta, yana mai da shi babban zaɓi ga masu haɓakawa waɗanda ke son rubuta lambar mai sauƙin fahimta. Python kuma yana da ɗimbin jama'a na masu haɓakawa waɗanda ke akwai don taimaka muku da ayyukanku, don haka ku tabbata cewa lambar ku za ta sami tallafi sosai.