Skip to main content

Ninth day for full stack development -->> Java Script: String, Primitive type, variable

JavaScript Begining

 clear{}--> to clear the console

Console Type :- 

REPL --> Read Evaluate Print Loop

Primitive type 

1. Number :- 

math operation

  • Format to do math operation. :- PEMDAS -> parenthesis, exponents, multi, division, addition, subtraction.
  • use Mod % for Remender if Zero than even and if 1 then odd, divide by2.
  • and two use exponent uses two-star(**)
  • use( typeof), to get which type o primitive type.

2. variable:-

  • .let
  • .Const> the values can not change, We store value does not change in your app, this does not work on array and object.
  • .var-->

Variable naming.

  • can use _
  • use lower case
  • not use no.

3. String :-

 can define in double quotes("") or single quotes ('')
use index in string :- var_name[0];
get index length :- var_name.length;
can add to string :- "lol"+"lol"; Plus sign(+) is concatination.
using method :- thing.method() ;
using property:- thing.properties;

Diff Strings Methods:-

Strings.trim() --> trim spaces,
strings.toUpperCase()--> capitalize the values

String  Method with Argument:-

strings.indexof('s') --> tells the s index value.
stings.slice(3,5) ->get the string between this index.
strings.replace(st , rp) ---> replace tht st by the rp output will be (rprings).
String.repeat(2) --> repeat the string.

String Template literals:-

`hello ${1+2+3} yes.`  --> start with a backslash (``) and use the dollar sign and curly braces (${variable_name}) to define variables and do the numerical calculation.













Comments