Basic JavaScript You Need to Know & SSL

Ujayer Ahmed Siddique
The Startup
Published in
5 min readNov 5, 2020

--

JavaScript Basic

Unlike the most programming languages, the JavaScript language has no concept of input or output.Which means it is designed to run as a scripting language in a host environment, and it is up to the host environment to provide mechanisms for communicating with the outside world. JavaScript supports functional programming — because they are objects, functions may be stored in variables and passed around like any other object.

JavaScript’s types are:

Numbers in JavaScript are "double-precision 64-bit format which means IEEE 754 values", according to the spec — There's no such thing as an integer in JavaScript (except BigInt). Addition, subtraction, modulus (or remainder) arithmetic, and so forth can also be done. Built-in parseInt() function is used to convert a string to an integer .

Strings in JavaScript are sequences of Unicode characters. This should be welcome news to anyone who has had to deal with internationalization. More accurately, they are sequences of UTF-16 code units; each code unit is represented by a 16-bit number. Each Unicode character is represented by either 1 or 2 code units. If anyone wants to represent a single character, you just use a string consisting of that single character.

Anyone can perform conversion explicitly using the Boolean() function:

Boolean('');  // false
Boolean(234); // true

JavaScript objects can be thought of as simple collections of name-value pairs. As such, they are similar to:

  • Dictionaries in Python.
  • Hashes in Perl and Ruby.
  • Hash tables in C and C++.
  • HashMaps in Java.
  • Associative arrays in PHP.
  • Function

A JavaScript function can take 0 or more named parameters. The function body can contain as many statements as anyone likes and can declare its own variables which are local to that function. The return statement can be used to return a value at any time, terminating the function. If no return statement is used (or an empty return with no value), JavaScript returns undefined.

Arrays in JavaScript are actually a special type of object. They work very much like regular objects (numerical properties can naturally be accessed only using [] syntax) but they have one magic property called 'length'. This is always one more than the highest index in the array.

Variables

New variables in JavaScript are declared using one of three keywords: let, const, or var.

let allows one to declare block-level variables.

const allows one to declare variables whose values are never intended to change.

var is the most common declarative keyword. It does not have the restrictions that the other two keywords have. This is because it was traditionally the only way to declare a variable in JavaScript. A variable declared with the var keyword is available from the function it is declared in.

Operators

JavaScript’s numeric operators are +, -, *, / and % which is the remainder operator . Values are assigned using =, and there are also compound assignment statements such as += and -=.

Instance methods of Strings

String.prototype.charAt(index)

Returns the character (exactly one UTF-16 code unit) at the specified index.

String.prototype.concat(str [, ...strN ])

Combines the text of two (or more) strings and returns a new string.

String.prototype.includes(searchString [, position])

Determines whether the calling string contains searchString.

String.prototype.endsWith(searchString [, length])

Determines whether a string ends with the characters of the string searchString.

String.prototype.indexOf(searchValue [, fromIndex])

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

String.prototype.lastIndexOf(searchValue [, fromIndex])

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

String.prototype.replace(searchFor, replaceWith)

Used to replace occurrences of searchFor using replaceWith. searchFor may be a string or Regular Expression, and replaceWith may be a string or function.

String.prototype.slice(beginIndex[, endIndex])

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

String.prototype.split([sep [, limit] ])

Returns an array of strings populated by splitting the calling string at occurences of the substring sep.

String.prototype.startsWith(searchString [, length])

Determines whether the calling string begins with the characters of string searchString.

String.prototype.substr()

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

Static methods of Numbers

Number.isNaN()

Determine whether the passed value is NaN .

Number.parseFloat(string)

This is the same as the global parseFloat() function.

Number.parseInt(string, [radix])

This is the same as the global parseInt() function.

Static methods of Maths

Math.abs(x)

Returns the absolute value of x.

Math.ceil(x)

Returns the smallest integer greater than or equal to x.

Math.floor(x)

Returns the largest integer less than or equal to x.

Math.max([x[, y[, …]]])

Returns the largest of zero or more numbers.

Math.min([x[, y[, …]]])

Returns the smallest of zero or more numbers.

Math.random()

Returns a pseudo-random number between 0 and 1.

Math.round(x)

Returns the value of the number x rounded to the nearest integer.

Math.sqrt(x)

Returns the positive square root of x.

Instance methods of Array

Array.prototype.concat()

Returns a new array that is this array joined with other array(s) and/or value(s).

Array.prototype.every()

Returns true if every element in this array satisfies the testing function.

Array.prototype.filter()

Returns a new array containing all elements of the calling array for which the provided filtering function returns true.

Array.prototype.find()

Returns the found element in the array, if some element in the array satisfies the testing function, or undefined if not found.

Array.prototype.findIndex()

Returns the found index in the array, if an element in the array satisfies the testing function, or -1 if not found.

Array.prototype.forEach()

Calls a function for each element in the array.

Array.prototype.indexOf()

Returns the first (least) index of an element within the array equal to an element, or -1 if none is found.

Array.prototype.join()

Joins all elements of an array into a string.

Array.prototype.pop()

Removes the last element from an array and returns that element.

Array.prototype.push()

Adds one or more elements to the end of an array, and returns the new length of the array.

Array.prototype.reduce()

Apply a function against an accumulator and each value of the array (from left-to-right) as to reduce it to a single value.

Array.prototype.reverse()

Reverses the order of the elements of an array in place. (First becomes the last, last becomes first.)

Array.prototype.shift()

Removes the first element from an array and returns that element.

SSL Guide For Beginners

As a consumer, one always want to see https:// when visiting any site you trust with your essential information. As a marketer, you’ll want to make sure you have an SSL or two for your audience.

SSL certificates are a small data files that cryptographically establish an encrypted link between a web server and a browser. This link ensures that all data passed between the web server and browser remain private.

Types Of Certificates

1.Extended Validation (EV) SSL Certificate

2. Organization Validated (OV SSL) Certificate

3. Domain Validation (DV) Certificate

4. Wildcard SSL Certificates

5. Unified Communications (UCC) SSL Certificate

6. Single Domain SSL Certificate

--

--

Ujayer Ahmed Siddique
The Startup

A tech enthusiast person. Loves to work using React js, JavaScript and in a word web Development.