Reprint : https://www.cnblogs.com/liuluteresa/p/6413988.html
 
stay js in , Everything is or can be used as an object . It can be done by new An object or create a variable directly in literal form ( Such as var i="aaa"), All variables have the properties of objects . Be careful : The object created by literal quantity will be temporarily wrapped as an object when calling properties and methods , Having the properties of an object . Such as
                       var str=" I'm not a real object ";
                       alert(str.length);     //str Temporarily packaged as a String object , The properties and methods of the object can be called
      But that doesn't mean it's an object ,typeof(i) The value of is still String.
      And by new The object of , Such as
                     var str=new String("aaa");
                     typeof("str")==Object;//true
Here are all the built-in objects ( Except Math And global objects , The rest are constructors )    
  
1. Global object
    attribute :
         Infinity      Specify a number of positive and negative infinities
         NaN        To specify a “ The digital ” value
         undefined    Specifies an unassigned variable
  Method :
      decodeURI()        For encrypted URI decode
       decodeURIComponent() For encrypted URI Component decoding
       encodeURI()        Encrypt the string to URI
       encodeURIComponent() Encrypt the string to URI Components
       escape(string)      Encrypt a string
        Use escape() Decoding a string
       eval_r(string)        Judge a string and execute it as script code
       isFinite(number)      Detect whether a value is a finite number , return True or False
       isNaN(string)      Detect whether a value is not a finite number
       Number()          Convert the value of an object to a number
       parseFloat(string)    Parse a string into a floating-point number
       parseInt(string)      Parse a string into an integer , It's not a rounding operation , It's tail cutting
       String(object)      Convert an object value to a string
       number(object)
 
2.Number
    attribute :
      MAX_VALUE       The largest possible value a number in JavaScript can have 1.7976931348623157E+308
      MIN_VALUE       The smallest possible value a number in JavaScript can have 5E-324
      NaN          Equal to a value that is not a number.
      NEGATIVE_INFINITY A value that is less than MIN_VALUE.
      POSOTIVE_INFINITY A value that is greater than MAX_VALUE.
      prototype       A static property of the Number object
    Method :
      toString       Returns a string representing the specified object
      valueOf()      Returns the original value of a mathematical object
 
3.Boolean
    attribute :
      constructor Function reference of the established object
      prototype    Properties and methods that can be added to objects
  Method :
      toSource()    Display the source code of the object
      toString()    Convert Boolean values to strings , And return the result
      valueOf()    Returns the original value of a Boolean object
 
4.String
    attribute :
      constructor Function reference of the established object
      prototype    Properties and methods that can be added to objects
      length      Returns the character length of a string
  Method :
      anchor("name") Used to convert a string to HTML In the anchor mark (<A NAME=>)
      big()      Turn the text in a string into a large font (<BIG>)
      blink()      Turn the text in a string into a flashing font (<BLINK>)
      bold()      Turn the text in a string into black (<B>)
      fixed()      Turn text in a string into a fixed pitch font , In the form of telegram (<TT>)
      fontcolor(color) Set the color of the text in the string (<FONT COLOR=>)
      Fontsize(size) Change the text in a string to a specified size (<FONTSIZE=>)
      italics()    Turn the text in a string into a diagonal font (<I>)
      Link(url) It's used to convert strings -HTML In the link tag (<A HREF=>)
      small()      Turn the text in a string into a small font (<SMALL>)
      strike()      Turn the text in a string into a crossed out font (<STRIKE>)
      sub()      Turn the text in a string into a subscript (subscript) typeface ((SUB>)
      sup()      Turn the text in a string into a superscript (superscript) typeface (<SUP>)
      charAt(index) Returns the character at the specified index
      charCodeAt(index) Returns an integer , This integer represents String Object that refers to the character at the locator Unicode code
      concat(string2) Connect two or more strings
      fromCharCode(num1, num2, …, numN) Get the specified Unicode Value and returns a string
      indexOf(searchString, startIndex) Returns the position of the first occurrence of the specified string in a string
      lastlndexOf(searchString, startIndex) Returns the position of the last occurrence of the specified string in a string
      match(regex) Find the specified value in the string
      replace(regex, newString) Replace some characters in a string with others
      search(regex) Find a string for an execution value
      slice(startIndex, endIndex) Extract some characters and return the rest in a new string
      split(delimiter) Assign strings to arrays
      substr(startIndex, length) from startIndex take , take length Characters
      substring(startIndex, endIndex) from startIndex and endIndex Characters between , barring endIndex
      toLowerCase() Make the text in the string lowercase
      toUpperCase() Capitalize the text in a string
      toSource()    Display the source code of the object
      valueOf()    Returns the original value of the string object
 
5.Array
    attribute :
      constructor Function reference of the established object
      prototype    Properties and methods that can be added to objects
      index      For an array created by a regular expression match, the zero-based index of the match in the string.
  input      For an array created by a regular expression match, reflects the original string against which the regular expression was matched.
  length      Get the number of array elements , That is, the maximum subscript plus 1
    Method (13):
  concat(array1,arrayn) Join two or more array values , Merge and return the result
  join(string) Merge elements in an array into a string ,string Separator . If the parameters are omitted, they will be merged directly , No more separation
  pop()      Remove the last element in the array and return it
  push(value) Add one or more elements to the end of the array , And returns the new array length value
  reverse()    Reverse the order of the elements in the array , In reverse
  shift()      Remove the first element in the array and return that element
  slice(start, deleteCount, [item1[, item2[,...[,itemN]]]]) Remove one or more elements from an array , if necessary , Insert a new element at the location of the removed element , Return the removed elements
  sort(compare Function) In the case of no sort number specified , In alphabetical order of the elements , If it's not a string type, it's converted to a string and sorted , Return sorted array
  splice()      Delete and add new elements to the array
  toSource()    Display the source code of the object
  toString()    Returns a string for all elements of the array , Separated by commas
  unshift(value) Add one or more elements to the beginning of the array , And returns the new length of the array
  valueOf()    Returns the original value of the array object
 
6.Object
    attribute :
  constructor Specifies the function that creates an object's prototype.
  prototype    Allows the addition of properties to all objects.
 
7.Function
    attribute :
  arguments    An array corresponding to the arguments passed to a function.
  arity      Indicates the number of arguments expected by the function.
  caller      Specifies which function called the current function.
  prototype    Allows the addition of properties to a Function object.
    Method :
  toString     Returns a string representing the specified object.
 
9.Date
    attribute (1):
  constructor      Function reference of the established object
  prototype        Properties and methods that can be added to objects
    Method (43):
  getDay()        Go back to the day of the week (0-6)
  getYear()        Return year .2000 Years ago 2 position ,2000( contain ) Later for 4 position
  getFullYear()      Return to the complete 4 Bit years
  getMonth()      Returns the number of months (0-11)
  getDate()        Return day (1-31)
  getHours()        Return hours (0-23)
  getMinutes()      Return to minutes (0-59)
  getSeconds()      Return seconds (0-59)
  getMilliseconds() Return milliseconds (0-999)
  getUTCDay()      According to international time, what day of the week is it (0-6)
  getUTCFullYear()    Get the complete year based on international time
  getUTCMonth()      According to international time (0-11)
  getUTCDate()      According to the international time to get the day (1-31)
  getUTCHours()      According to international time to get hours (0-23)
  getUTCMinutes()    Return minutes according to international time (0-59)
  getUTCSeconds()    Return seconds according to international time (0-59)
  getUTCMilliseconds() Returns milliseconds based on international time (0-999)
  getTime()        Return from 1970 year 1 month 1 Number 0:0:0 The total number of milliseconds spent so far
  getTimezoneoffset() Returns the time zone deviation value , Greenwich mean time (GMT) The number of minutes that differ from the time zone setting of the computer running the script )
  parse(dateString)    Back in the Date In the string since 1970 year 1 month 1 Japan 00:00:00 Milliseconds since
  setYear(yearInt)    Set year .2 Number of digits or 4 digit
  setFullYear(yearInt) Set year .4 digit
  setMonth(monthInt) Set month (0-11)
  setDate(dateInt)    Set day (1-31)
  setHours(hourInt) Set the hours (0-23)
  setMinutes(minInt) Set minutes (0-59)
  setSeconds(secInt) Set seconds (0-59)
  setMilliseconds(milliInt) Set milliseconds (0-999)
  setUTCFullYear(yearInt) Set the year according to international time
  setUTCMonth(monthInt) Set the month according to international time (0-11)
  setUTCDate(dateInt)      Set the day according to international time (1-31)
  setUTCHours(hourInt)    Set the hours according to international time
  setUTCMinutes(minInt) Set the minutes according to international time
  setUTCSeconds(secInt)    Set seconds according to international time
  setUTCMilliseconds(milliInt) Set milliseconds according to international time
  setTime(timeInt)    Set from 1970 year 1 month 1 The beginning of the day . Number of milliseconds
  toGMTString()      According to Greenwich mean time Date Date of object ( A number ) Turn into a GMT Time string , Such as :Weds,15 June l997 14:02:02 GMT
  toUTCString()      According to the universal time, a Date Object to a string
  toLocaleString()    hold Date Date of object ( A number ) Converts to a string , Use the specific date format configured for use on your computer
  toSource()        Display the source code of the object
  toString()        Convert the date object to a string
  UTC(yyyy, mm, dd, hh, mm, ss, msec) Returns the gap between Greenwich mean time and the specified time , The unit is millisecond
  valueOf()        Returns the original value of the date object
 
10.Math
    attribute :
  constructor      Function reference of the established object
  prototype        Properties and methods that can be added to objects
  E            Euler constant , The base of natural logarithm ( About equal to 2.718)
  LN2          2 The natural logarithm of ( About equal to 0.693)
  LN10          10 The natural logarithm of ( About equal to 2.302)
  LOG2E          With 2 At the bottom of the e The logarithmic .( About equal to 1.442)
  LOG10E          With 10 At the bottom of the e The logarithmic ( About equal to 0.434)
  PI           ∏ Value ( About equal to 3.14159)
  SQRT1_2        1/2(0.5) The square root of ( namely l Divide 2 The square root of , About equal to o.707)
  SQRT2         2 The square root of ( About equal to 1.414)
    Method :
  abs(x)      Returns the absolute value of the number
  acos(x)    Returns the arccosine of a number
  asin(x)    Returns the arcsine of a number
  atan(x)    Return to the location of -PI/2 and PI/2 The arctangent of
  atan2(y,x) return (x,y) be located -PI To PI The angle between
  ceil(x)    return x The largest integer rounded
  cos(x)      Returns the cosine of a number
  exp(x)      return E^x value
  floor(x)    return x The smallest integer rounded
  log(x)      The return base is E The natural logarithm of
  max(x,y)    return x and y The larger number between
  min(x,y)    return x and y The smaller number between
  pow(x,y)    return y^x Value
  random()    Return to the location of 0 To 1 The random function between
  round(x)    Round and round
  sin(x)      Returns the sine of a number
  sqrt(x)    Return the square root of the number
  tan(x)      Returns the tangent of an angle
  toSource() Display the source code of the object
  valueOf() Returns the original value of a mathematical object

js More articles on built-in objects for

  1. js arguments Built-in objects

    1.arguments yes js Built in objects for . 2. In the case of uncertain objects can be used to overload functions . 3. Usage is as follows : function goTo() { var i=arguments.length; alert(i); ...

  2. js Single built-in object

    js Single built-in object :js Built in objects for , yes ECMAScritp Provided . Objects that do not depend on the host environment , My understanding is that before we develop js Objects that already exist inside . Single built-in objects don't need to pass through new To instantiate , For example, our st ...

  3. js Common built-in objects 、Dom object 、BOM object

    11.html Element event attribute , Such as onclick="", The double quotation marks can be the method bar , It can be js Code ( No need to add <script> label ) 12.JavaScript built-in object . Properties and ...

  4. JS Built in objects and JQuery Part of

     [js In the array ]              1  The concept of array : The structure of multiple ordered elements that can be continuously stored in memory                 The order of the elements : It's called subscript , Find the corresponding element by subscript .           ...

  5. js Common built-in objects and methods

    stay js Everything is an object : character string , Array , The number , function ...... Built in objects have their own properties and methods , The access method is as follows : Object name . The attribute name : Object name . Method name 1.Array Array objects unshift( )     An array of open ...

  6. JS Common built-in objects and methods

    JS Built in objects commonly used in :Array object .Date object . Regular expression objects .string object .Global object   Array Object : concat() Means to combine several arrays into one join()   set up ...

  7. JS Basics - Built-in objects 【 character string +Date+Math】

    JS Built-in objects [ character string ] // charAt() Return character // charCodeAt() Return character's unicode code var str="hello world"; console ...

  8. JS Single built-in object

    Built-in objects : from ECMAScript Provided . Objects that do not depend on the host environment , These objects are ECMAScript Before the program is executed . There is no need for developers to explicitly instantiate built-in objects such as : Object Array Str ...

  9. JS The built-in object of monomer Math Common methods (min,max,ceil,floor,round,random etc. )

    1.min() and max() Method Math.min() Used to determine the minimum of a set of values .Math.max() Used to determine the maximum value in a set of values . alert(Math.min(2,4,3,6,3,8,0,1,3)); ...

Random recommendation

  1. Package the library into nuget The server

      Preface Due to the present .net core Cannot reference local  assembly , So try to package the dependency Library of the project into nuget The server .   Related tools Nuget Package Explorer Reference documents dotnet ...

  2. The history of software project development &lt; One month myth &gt; This book is good

    It's almost the history of computer software development     One month myth , Increasing the number of people doesn't necessarily increase the speed of development . The reason lies in , Some tasks can't be broken down , There's a sequence . Can't synchronize . More people , What's increasing is the cost of communication , Check each other out . Tasks that can be broken down are ...

  3. Uninstall complete vs2010 Then install

    After installation vs2010 after , Changed the drive letter , cause vs Tools can't be used , So you need to uninstall vs2010 Use Microsoft Visual Studio 2010 Uninstall Utility To uninstall vs201 ...

  4. Oracle Exception handling for stored procedures

    Oracle Exception handling for stored procedures 1. Exceptional advantages     If there is no abnormality , In the program , Each command should be checked for success or failure , Such as   BEGIN  SELECT ...  -- check for ’no data f ...

  5. ExtJs

    ExtJS It's mainly used to create a front-end user interface , It's a front end that has nothing to do with the back end technology ajax frame .       Concept 1.ExtJS Can be used for development RIA That is, rich client's AJAX application , It's a use. javascript Written , It mainly uses ...

  6. 【 original 】TP-LINK +ASUS(Tomato) Dual wireless routing settings WDS

    Main route : TP-LINK TL-WR2041N Connect Internet,LAN IP Address :192.168.1.1, Enable DHCP, The wireless configuration is as follows : Turn on WDS function ,wireless For secondary routing SSID,BS ...

  7. Redis The source code parsing

    http://programmers.stackexchange.com/questions/49550/which-hashing-algorithm-is-best-for-uniqueness- ...

  8. c/c++ Memory mechanism ( One )( turn )

    from :http://www.cnblogs.com/ComputerG/archive/2012/02/01/2334898.html One :C Memory mechanism in language stay C In language , Memory is mainly divided into the following 5 Two storage areas : ...

  9. InputStreamReader and OutputStreamWriter Class usage Introduction , And demonstration .

    InputStreamReader and OutputStreamWriter Class usage Introduction . One .InputStreamReader class InputStreamReader Convert byte stream to character stream . yes ...

  10. [ Reptiles ]BeautifulSoup4

    1.Beautiful Soup An introduction to the Beautiful Soup yes python A library , The main function is to grab data from web pages . The official explanation is as follows : Beautiful Soup Provide some simple .python The letter of the formula ...