What is null ? doing in this line of JavaScript -


इस सवाल का पहले से ही एक उत्तर है: < / P>

  • 6 जवाब

मेरे पास कोड की यह पंक्ति है जेएस में भुगतान सौंपने के लिए, लेकिन मुझे यकीन नहीं है कि यह क्या कर रहा है क्योंकि मैंने कभी इस वाक्यविन्यास चीनी में कुछ नहीं देखा है।

<पूर्व> var fund = response.card! = नल? Response.card [0]: response.bank_acct [0];

यह सशर्त ऑपरेटर है। इसे लिखने के बजाय:

  var फंड; अगर (response.card! = नल) {fund = response.card [0]} अन्य {fund = response.bank_acct [0]; }  

आप इसे लिख सकते हैं:

  var fund = response.card! = Null? Response.card [0]: response.bank_acct [0];  

Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -