Stopp Posted October 1, 2006 Report Share Posted October 1, 2006 var i="1"; var s=i+1; s iznāk nevis 2, bet gan 11. tas laikam ir tāpēc, ka i ir 1 pēdiņās, līdz ar ko tas vairs nav numeric strings. kā var dabūt, lai s iznāktu 2? Link to comment Share on other sites More sharing options...
bubu Posted October 1, 2006 Report Share Posted October 1, 2006 To pašu, ko iekš php - kāstot uz skaitlisku tipu: var s=Number(i)+1; // ņem vērā, ka Number atgriezīs NaN, ja i nebūs skaitlis http://docs.sun.com/source/816-6408-10/toplev.htm#1064092 P.S. malacis, ka var lieto. Link to comment Share on other sites More sharing options...
Stopp Posted October 1, 2006 Author Report Share Posted October 1, 2006 paldies. P.S. malacis, ka var lieto. ? nesapratu. Link to comment Share on other sites More sharing options...
bubu Posted October 1, 2006 Report Share Posted October 1, 2006 Malacis, ka lieto "var" keywordu. Link to comment Share on other sites More sharing options...
Delfins Posted October 2, 2006 Report Share Posted October 2, 2006 tu domā ka viņš zin, ko tas nozīmē? :) Link to comment Share on other sites More sharing options...
IM24LV Posted October 2, 2006 Report Share Posted October 2, 2006 tu domā ka viņš zin, ko tas nozīmē? :) emm, ieej vinja maajsalapaa stopp.ex.lv vinsh daudz ko zin ;) Link to comment Share on other sites More sharing options...
Stopp Posted October 2, 2006 Author Report Share Posted October 2, 2006 Malacis, ka lieto "var" keywordu. nu jā, bet nesaprotu, kas tur tik eksepšnāls. Link to comment Share on other sites More sharing options...
bubu Posted October 2, 2006 Report Share Posted October 2, 2006 Eksepšenāls tur ir tas, ka neviens to nelieto tādējādi rakstot sliktu un "nesmuku" kodu. Ceru, ka tu vismaz saproti, ko tas "var" nozīmē? Link to comment Share on other sites More sharing options...
Stopp Posted October 2, 2006 Author Report Share Posted October 2, 2006 variable, ko tad vēl. Link to comment Share on other sites More sharing options...
Grey_Wolf Posted October 2, 2006 Report Share Posted October 2, 2006 Eksepšenāls tur ir tas, ka neviens to nelieto Nu nu skjiet ka vismaz 50% kodu paraugos (piemeros tas tiek lietots... :) un domaaju ka tie kas pashi daudzmaz raksta JS lieto 'var' Jo savaadaak garaakaa koda gabalaa var 'Nosauties' jo nevar saprast kas ir kas.... Link to comment Share on other sites More sharing options...
bubu Posted October 2, 2006 Report Share Posted October 2, 2006 Stopp, da nē, ne jau kautkādu "pilno" nosaukumu, bet tā semantiku tev prasīju. Vai zini atšķirību starp kodu: a=1; un kodu: var a=1; Abi ir valīdi JS koda gabaliņi. Jo lietot kautko, ko nezini, tikai tāpēc, ka visi citi tā dara, pats ceru saproti, ka ir bezjēdzīgi. Link to comment Share on other sites More sharing options...
Recommended Posts