Methods

Posted Veritas des Liberty

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Methods相关的知识,希望对你有一定的参考价值。

  • string.prototype.trim()

    • The trim() method removes whitespace from both ends of a string. Whitespace in this context is all the whitespace characters (space, tab, no-break space, etc.) and all the line terminator characters (LF, CR, etc.).
    • Description

      The trim() method returns the string stripped of whitespace from both ends. trim()does not affect the value of the string itself.

    • var orig = ‘   foo  ‘;
      console.log(orig.trim()); // ‘foo‘
      
      // Another example of .trim() removing whitespace from just one side.
      
      var orig = ‘foo    ‘;
      console.log(orig.trim()); // ‘foo‘
      

       

  • String.prototype.toUpperCase()

    •   The toUpperCase() method returns the calling string value converted to uppercase (the value will be converted to a string if it isn‘t one).
    • Description

      The toUpperCase() method returns the value of the string converted to uppercase. This method does not affect the value of the string itself since javascript strings are immutable.

      You cannot call this method on null or undefined (via Function.prototype.call, for example) , if you do, a TypeError will be thrown.

    • console.log(‘alphabet‘.toUpperCase()); // ‘ALPHABET‘
      

       

 

以上是关于Methods的主要内容,如果未能解决你的问题,请参考以下文章

调用 Web Service Async-methods 需要很长时间才能返回结果如何处理

Improving DNNs Hyperparameter tuning-Regularization and Optimization(week2)Optimization Methods(示例代码

wepy怎么在methods中调用methods的方法

Vue的methods里面的this为什么会指向Vue实例?

Vue的methods里面的this为什么会指向Vue实例?

vue实例方法 example methods