Mujeeb Ahmed Profile picture
Mar 24 10 tweets 4 min read
Number Methods in JavaScript 🔥.
A thread.
#javascript30
#webdev
1. Number() Method:-

- The Number() function is used to convert various data types to numbers.

Syntax:- Number(value)

Example:-
2. parseInt():-

- This function converts a decimal number to an integer value.

Syntax:- parseInt(value)

Example:-
3. parseFloat():-

- This function works in the same way as parseInt, but it returns both integer and decimal values.

Syntax:- parseFloat(value)

Example:-
4. isFinite():-

The Number.isFinite() method returns true if a number is a finite number.

Infinite (not finite) numbers are Infinity, -Infinity, or NaN
Otherwise it returns false.

Syntax:- Number.isFinite(value)

Example:-
5. isInteger();-

The Number.isInteger() method returns true if a value is an integer of the datatype Number.

Otherwise it returns false.

Syntax:- Number.isInteger(value)

Example:-
6. toFixed():-

- The toFixed() method converts a number to a string.

- The toFixed() method rounds the string to a specified number of decimals.

- If the number of decimals are higher than in the number, zeros are added.

Syntax :- number.toFixed(x)

Example:-
7. toPrecision():-

- The toPrecision() method formats a number to a specified length.

- A decimal point and nulls are added (if needed), to create the specified length.

Syntax:- number.toPrecision(x)

Example:-
8. toExponential() :-

- The toExponential() method converts a number into an exponential notation.

Syntax:- number.toExponential(x)

Example:-
If you enjoyed reading this thread, please do the following:
1. Retweet the first tweet.
2. Follow me and enable notifications: @mujeeb0147.

Thank you for reading all the way through👐.

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Mujeeb Ahmed

Mujeeb Ahmed Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @mujeeb0147

Mar 22
JavaScript String Methods and Properties.

A Mega 🧵. Image
1. What is a JavaScript String?
- JavaScript strings are for storing and manipulating text.
-A JavaScript string is zero or more characters written inside quotes.

➡️Example:- Image
2. JavaScript Methods and Properties.

2.1. String length

To find the length of a string, use the built-in length property:

Example:- Image
Read 21 tweets
Mar 15
JavaScript Looping Array Elements🚀(Thread).
1. The for loop:

for loop is used when you want to execute a block of code as long as a specified condition is true.

Syntax :
Examples:
2. for Each:
The forEach() method calls a function (a callback function) once for each array element.

Syntax :
Example:

Note:- the function takes 3 arguments:

The item value.
The item index.
The array itself.

The example below uses only the value parameter.
Read 9 tweets
Mar 9
JavaScript Arrays🤩, Mega thread🚀.
All of the content includes examples so that any aspiring Web developer can quickly grasp the concepts. Image
1. What is a JavaScript Arrays.
An array in JavaScript is a variable that can hold several values.
Example: Image
2. What's the Point of Using an Array?
If you have a list of items (say, a list of car names), storing the cars in single variables might look like this:
Example: Image
Read 25 tweets
Mar 7
JavaScript Objects 🔥🔥(Thread).
1. What is an Object in JavaScript?

The Object class represents one of JavaScript's data types. It's used to store keyed collections as well as more complex entities
2. How can you Create a JavaScript Object?

With JavaScript, you can define and create your objects.

There are different ways to create new objects:

1. Create a single object, using an object literal.

2. Create a single object, with the keyword new.
Read 11 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us on Twitter!

:(