0% found this document useful (0 votes)
5 views

JAVASCRIPT

Uploaded by

dpkaa03
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

JAVASCRIPT

Uploaded by

dpkaa03
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

JAVASCRIPT

printing ke lie-
console.log

in VS CODE
when u write the code then run it and then in terminal write --PS D:\destop\java>
node tut.js then the output will be shown

console.warn se woh text mei warning aa jayegi --warning ka sign aayega


console.clear() se saare console ki chiz clear ho jayegi

console.error() se error dikhayega--x ka sign aayega

variable name can start from $ also


and case sensitive hai

datattype
var-- used for chanign variable

var---variablename;--datatype is undefined

let--is like var only


ek baar hee declare kar sakte h

hoisting-- var mei agar chize code ke neeche declare kare tab bhi usse upar agar
use kare toh error nhi dikahyega

const--- age mei agar ek baar value de de toh wahi rahega...cant change
and value dena hee hoga otherwise syntax error aayega..we have to intiiatiles

comment- //
multiline mei /* */

DATA TYPE CONTINUE


isme decimal and interger ko number hee manta h..no change

reference--are datatype aderived from primitive ones


object and array
array== conbimation of dataype..like list in python
object== dictionary..isme console.log(dictname.key) karne se uss key ki value aa
jayegi

let age=;
let age=null;

terminal mei node likhenge toh joh inspect mei kar rhe thee woh idhaar bhi kar
sakte..par web pe better h

let use karne se datatype fix ho jayega..fir baad mei agar operation karna hoga toh
wahi datatype mei hee karna hoga

par iss drawback ke liye h TYPESCRIPT--alag programming language

let new arr=arr.map(


element ==>{
return element*2})----same aray ko modify nhi karta new array declare karke usme
change karna hota

fat arrow =>

for writing a function


const newfun=()

functions== array function

array.foreach(
el=>el*2)

CAMELCASE
Example isOnline

=== se datatype check hoga

node is engine
and google is os
alert ke dialogue block ke liye write
alert("good")

prompt se dialogue box banta h jisme hum value likh sakte par usme ek function
likhna hoga jisse hum value access kar sakte
document object model -modcmanipulation--GOAL

arrayname.toh fuction aayega


push funtion se last mei add hoga
console.log mei 2-3 chize saath mei print kar skate h("lala", array)--new in java
push function se same array mei change aayega
par map function se hame new array mei changes lani hoti h

new funtion

let moreFruits=[...fruits]--copy karne ke liye subtrat operator--ne in java


nating se ek hee code se android mei bhi windows me bhi chalega
typescription

how to check if array mei element h ya nhi


filter array based on condition

console.log(fruits.include('apple'))

let result=fruits.filter(item=>(item=='apple')) se andar ka ()mei true aayega and


fir result mei woh aa jayega

You might also like