To know JavaScript string, number.

Afroza Akter Ruma
3 min readMay 6, 2021

--

JavaScript String

toUppercase:

toUppercase is a string function or string method. If you enter a string here, it will uppercase all the characters in that string.

Var line = ‘Hunny Coders community’

console.log(line.toUpperCase())

Output: HUNNY CODERS COMMUNITY

toLowercase:

toLowercase is a string function or string method. If you enter a string here, it will Lowercase all the characters in that string.

Var line = ‘Hunny Coders community’

console.log(line.toUpperCase())

Output: hunny coders community

substring:

The substring takes two arguments, start and end. The argument we will give at the start and end will be the number of the two. The part of the string between these two numbers will return the part, meaning the substring is used to cut the small part of the string.

Var line = ‘Hunny Coders community’

console.log(line.substring(5,12))

Output: Coders

Slice:

Similar to slice substring but one power of slice is if minus number is placed in slice then you have to give two from the end then cut only that part but if you put minus in substring it will show mt string.

Var line = ‘Hunny Coders community’

console.log(line.slice(-9))

Output: community

indexof:

If you put a character or alphabet in the indexof, the number of indexes of the string that will give the index will return the indexof.

Var line = ‘Hunny Coders community’

console.log(line.indexof(‘C’))

Output: 6

charAt:

It’s the opposite of indexof. Returning a character here returns the string of that character.

Var line = ‘Hunny Coders community’

console.log(line.charAt(16))

Output: 109

trim:

If there is extra space in a string, it is the job of the trim to cut that extra space and keep only as much space as possible.

spilt:

A string can be created as an array through split.

JavaScript Number

isNone:

The Number.isNaN() method determines whether the passed value is NaN and its type is Number.

In comparison to the global isNaN() function, Number.isNaN() doesn’t suffer the problem of forcefully converting the parameter to a number. This means it is now safe to pass values that would normally convert to NaN, but aren’t actually the same value as NaN. This also means that only values of the type number, that are also NaN, return true.

parsInt:

The Number.parseInt() method parses a string argument and returns an integer of the specified radix or base.

The function of parsInt is to first search whether there is a number in a string, then convert the string to integer.

parseFloat:

parseFloat is a function feature of the global object.

If the parsefloat encounters any character other than plus sign (+), minus sign (- U + 002d hyphen-minus), number (0–9), decimal point (.), Or exponent (e or e), it returns Invalid character arrives and ignores the character following it, determine the value of this character.The second decimal point also stops parsing (characters up to that point will still be analyzed).

Parsflot will parse non-string objects if they have a string or standard method. The return value is called parsefloat as a result of those methods.

SSL:

SSL basically enhances the security of a website. The benefit of SSL is available to both the owner of the website and the user. How do you get the benefit? Suppose an online website has a payment form to buy something. There is a payment option. When the fill up kore data is given, at that very moment, if the SSL is not done, the hacker can easily get the user’s data.

And if the website is SSL, when the user fills up the form, the data that is sent to the database is encrypted, which the hacker cannot understand. So SSL plays a very important role.

--

--