Posts by Macronaut • 41 points
2 posts
-
0
votes3
answers664
viewsA: How to convert a numeric value to Boolean?
I would most likely do something like this: var status = 1; // value received $("#status"). prop('checked', Number(status) ? true : false); Using ternary same, and converting the value always in a…
-
4
votes3
answers3579
viewsA: How many days is the current month with Javascript?
function _numDias(){ var objData = new Date(), numAno = objData.getFullYear(), numMes = objData.getMonth()+1, numDias = new Date(numAno,…
javascriptanswered Macronaut 41