By: aathishankaran in Javascript Tutorials on 2007年03月21日 [フレーム]
The second set of objects never appears visually, but you work with them within your JavaScript code. You can call them built-in language objects because they are simply constructs of the JavaScript language. Anyone who has worked with any programming language before has worked with the following types of objects:
The string object represents a value you assign to a variable of an object property. JavaScript treats both assigned variables and string literals as string objects.
The array object is an object representation of the traditional programming construct. An array is an ordered set of data elements, and every index number in an array contains a value. You can have as many indexes in the array as you want.
Arrays are powerful and your JavaScript scripts can use them in a variety of ways. The following code segment shows a simple example.
<HTML>
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
theJs = new Array(3)
theJs[l] = "Jordan"
theJs[2] = "Jared"
theJs[3] = "Justin"
document.write("<H1>The three Js are:</H1>")
document.write("<OL>")
for (var i = 1; i < 4; i++) {
document.write("<LI>" + theJs[i])
}
document.write("</OL>")
</SCRIPT>
</HEAD>
</HTML>
The math object is used for standard mathematical calculations. Rather than using generic math functions in JavaScript, these functions are implemented as methods of the math object. Suppose you wanted to evaluate two numbers that the user entered.
This policy contains information about your privacy. By posting, you are declaring that you understand this policy:
This policy is subject to change at any time and without notice.
These terms and conditions contain rules about posting comments. By submitting a comment, you are declaring that you agree with these rules:
Failure to comply with these rules may result in being banned from submitting further comments.
These terms and conditions are subject to change at any time and without notice.
Most Viewed Articles (in Javascript )
Dynamically modify the option set in Dynamics 365 forms
promise and .then() in JavaScript
reduce() and filter() in JavaScript
History and evolution of Javascript
Using parseInt() and parseFloat() in JavaScript to convert data types to Numbers
Show how many characters remaining in a html text box using javascript
Latest Articles (in Javascript)
© 2023 Java-samples.com
Tutorial Archive: Data Science React Native Android AJAX ASP.net C C++ C# Cocoa Cloud Computing EJB Errors Java Certification Interview iPhone Javascript JSF JSP Java Beans J2ME JDBC Linux Mac OS X MySQL Perl PHP Python Ruby SAP VB.net EJB Struts Trends WebServices XML Office 365 Hibernate
Latest Tutorials on: Data Science React Native Android AJAX ASP.net C Cocoa C++ C# EJB Errors Java Certification Interview iPhone Javascript JSF JSP Java Beans J2ME JDBC Linux Mac OS X MySQL Perl PHP Python Ruby SAP VB.net EJB Struts Cloud Computing WebServices XML Office 365 Hibernate