Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Class notes

javascript_builtin_functions.pdf,

Rating
-
Sold
-
Pages
7
Uploaded on
22-01-2024
Written in
2022/2023

JavaScript's built-in functions are your Swiss Army knife, ready to tackle everyday coding challenges. These handy tools cover a vast range, from basic math operations like `sqrt` and `pow` to string manipulation with `slice` and `toUpperCase`. Date ninjas can wield `getDate` and `getFullYear`, while logic masters have `if` and `switch` at their fingertips. Error handling is a breeze with `try` and `catch`, and debugging gets a boost with ``. Mastering these built-in gems lets you write cleaner, more efficient code, leaving you free to focus on the core logic of your program. So, sharpen your coding skills and dive into this treasure trove – JavaScript's built-in functions are your secret weapons for crafting robust and elegant code.

Show more Read less
Institution
Course

Content preview

JAVASCRIPT BUILT-IN FUNCTIONS
http://www.tutorialspoint.com/javascript/javascript_builtin_functions.htm Copyright © tutorialspoint.com


NUMBER METHODS
The Number object contains only the default methods that are part of every object's definition.


Method Description

constructor Returns the function that created this object's instance. By default this is the
Number object.

toExponential Forces a number to display in exponential notation, even if the number is in
the range in which JavaScript normally uses standard notation.

toFixed Formats a number with a specific number of digits to the right of the
decimal.

toLocaleString Returns a string value version of the current number in a format that may
vary according to a browser's locale settings.

toPrecision Defines how many total digits includingdigitstotheleftandrightofthedecimal to display
of a number.

toString Returns the string representation of the number's value.

valueOf Returns the number's value.



BOOLEAN METHODS
Here is a list of each method and its description.


Method Description

toSource Returns a string containing the source of the Boolean object; you can use
this string to create an equivalent object.

toString Returns a string of either "true" or "false" depending upon the value of the
object.

valueOf Returns the primitive value of the Boolean object.


String Methods
Here is a list of each method and its description.


Method Description

charAt Returns the character at the specified index.

charCodeAt Returns a number indicating the Unicode value of the character at the
given index.

concat Combines the text of two strings and returns a new string.

indexOf Returns the index within the calling String object of the first occurrence of
the specified value, or -1 if not found.

, lastIndexOf Returns the index within the calling String object of the last occurrence of
the specified value, or -1 if not found.

localeCompare Returns a number indicating whether a reference string comes before or
after or is the same as the given string in sort order.

length Returns the length of the string.

match Used to match a regular expression against a string.

replace Used to find a match between a regular expression and a string, and to
replace the matched substring with a new substring.

search Executes the search for a match between a regular expression and a
specified string.

slice Extracts a section of a string and returns a new string.

split Splits a String object into an array of strings by separating the string into
substrings.

substr Returns the characters in a string beginning at the specified location
through the specified number of characters.

substring Returns the characters in a string between two indexes into the string.

toLocaleLowerCase The characters within a string are converted to lower case while
respecting the current locale.

toLocaleUpperCase The characters within a string are converted to upper case while
respecting the current locale.

toLowerCase Returns the calling string value converted to lower case.

toString Returns a string representing the specified object.

toUpperCase Returns the calling string value converted to uppercase.

valueOf Returns the primitive value of the specified object.



STRING HTML WRAPPERS
Here is a list of each method which returns a copy of the string wrapped inside the appropriate
HTML tag.


Method Description

anchor Creates an HTML anchor that is used as a hypertext target.

big Creates a string to be displayed in a big font as if it were in a <big> tag.

blink Creates a string to blink as if it were in a <blink> tag.

bold Creates a string to be displayed as bold as if it were in a <b> tag.

fixed Causes a string to be displayed in fixed-pitch font as if it were in a <tt> tag

fontcolor Causes a string to be displayed in the specified color as if it were in a <font
color="color"> tag.

fontsize Causes a string to be displayed in the specified font size as if it were in a
<font size="size"> tag.

italics Causes a string to be italic, as if it were in an <i> tag.

Written for

Institution
Course

Document information

Uploaded on
January 22, 2024
Number of pages
7
Written in
2022/2023
Type
Class notes
Professor(s)
Bhupendra ratan
Contains
All classes

Subjects

$11.19
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller
Seller avatar
ashishsharma6

Get to know the seller

Seller avatar
ashishsharma6 Galgotia University Delhi
Follow You need to be logged in order to follow users or courses
Sold
-
Member since
2 year
Number of followers
0
Documents
1
Last sold
-

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions