how to get numeric value from string?

前端 未结 5 910
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-02-08 23:54

This will alert 23.

alert(parseInt(\'23 asdf\'));

But this will not alert 23 but alerts NaN

alert(parseInt(\'asdf 23\'));
         


        
5条回答
提交回复
热议问题