-
Notifications
You must be signed in to change notification settings - Fork 0
/
javascript.html
642 lines (564 loc) · 34.8 KB
/
javascript.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
<!DOCTYPE html>
<html lang="en">
<head>
<!-- meta -->
<meta charset="utf-8">
<meta content="width=device-width, initial-scale=1.0" name="viewport">
<title>:: Rajesh Personal questions ::</title>
<meta content="" name="keywords">
<meta content="" name="description">
<!-- Google Fonts -->
<link href="https://fonts.googleapis.com/css?family=Poppins:300,300i,400,400i,500,500i,600,600i,700,700i|Playfair+Display:400,400i,700,700i,900,900i" rel="stylesheet">
<!-- Bootstrap CSS File -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<!-- Libraries CSS Files -->
<link href="css/ionicons.min.css" rel="stylesheet">
<link href="css/font-awesome.min.css" rel="stylesheet">
<link href="css/owl.carousel.min.css" rel="stylesheet">
<link href="css/magnific-popup.css" rel="stylesheet">
<link href="css/hover.min.css" rel="stylesheet">
<!-- Main Stylesheet File -->
<link href="css/style.css" rel="stylesheet">
<!-- Responsive css -->
<link href="css/responsive.css" rel="stylesheet">
<!-- Favicon -->
<link rel="shortcut icon" href="images/favicon.png">
<script data-ad-client="pub-6300849404698883" async src="https://pagead2.googlesyndication
.com/pagead/js/adsbygoogle.js"></script>
</head>
<body>
<!-- start section navbar -->
<nav id="main-nav">
<div class="row">
<div class="container">
<div class="logo">
<a href="index.html"><img src="images/logo1.png" alt="logo"></a>
</div>
<div class="responsive"><i data-icon="m" class="ion-navicon-round"></i></div>
<ul class="nav-menu list-unstyled">
<li><a href="all.html" class="smoothScroll">Html</a></li>
<li><a href="javascript.html" class="smoothScroll">Javascript</a></li>
<li><a href="jquery.html" class="smoothScroll">Jquery</a></li>
<li><a href="angular.html" class="smoothScroll">Angular</a></li>
<li><a href="doc.html" class="smoothScroll">DOC</a></li>
</ul>
</div>
</div>
</nav>
<!-- End section navbar -->
<!-- start section header -->
<div class="html">
<div class="container">
</div>
</div>
<!-- End section header -->
<!-- start section about us -->
<div id="about">
<div class="mn_n">
<div class="container">
<div class="row">
<div class="col-lg-6">
<h2>Javascript</h2><br/>
<h5>What Are The Core Data Types Available In JavaScript?</h5>
<p>Number<br/>
Object<br/>
String<br/>
Boolean<br/>
Function<br/>
Null<br/>
Undefined</p>
<h5>What Is The Difference Between Undefined Value And Null Value?</h5>
<p> undefined and null are equal in value but different in type:</p>
<span><img src="images/typ.jpg"></span>
<p>undefined means a variable has been declared but has not yet been assigned a value. On the other hand, null is an assignment value. It can be assigned to a variable as a representation of no value</p>
<h5>what is function ?</h5>
<p>A JavaScript function is a block of code designed to perform a particular task. A JavaScript function is executed when "something" invokes it (calls it).</p>
<span><img src="images/typ.jpg"></span>
<p>Using function we can reuse code once define the code we can use many times with different arguments to different results</p>
<h5>What Is Scope In JavaScript?</h5>
<p>The general meaning of scope is the accessibility of functions and variables in an application. Usually, we use them in two ways, i.e., Local and Global.
<p>
<b>A) Local Scope</b><br/>
If we declare a function or variable inside a function, then we can access it only inside that function.
<span><img src="images/lcl.jpg"></span>
</p>
<p>
<b>B) Global Scope</b><br/>
Declaring a variable anywhere on the page would mean that we can access it from any of the functions on that page.
<span><img src="images/gbl.jpg"></span>
</p>
</p>
<h5>what is JavaScript Objects ?</h5>
<p>it will holds multiple values in terms of properties and methods.</p>
<P>we will write objects inside curly bracket</P>
<span><img src="images/ob.jpg"></span>
<p>we can access object properties in two ways</p>
<p><b>objectName.propertyName,........, objectName["propertyName"]</b></p>
<h5>Object Methods</h5>
<p>Objects can also have methods. Methods are stored in properties as function definitions.</p>
<span><img src="images/ppt.jpg" style="width:100%"></span>
<h5>JavaScript Strings</h5>
<p>JavaScript strings are used for storing and manipulating text. will store in ("" or '') quotes</p>
<p><b>JavaScript String Methods</b></p>
<p>finding String in a String </p>
<p>using indexof() method we can find string position of the first EX : var pos = str.indexOf("locate");</p>
<p>using lastIndexOf() method we can find string position of the last EX : var pos = str.lastIndexOf("locate");</p>
<p>Both methods accept a second parameter as the starting position for the search EX: var pos = str.indexOf("locate", 15);</p>
<p>using search() method we can search position of matched lement EX : var pos = str.search("locate");</p>
<p><b>indexOf() and search() both are not equal</b> : ==> search() method cannot take a second start position argument.<br/>The indexOf() method cannot take powerful search values.</p>
<p><b>Extracting String Parts</b></p>
<p>3 methods for extracting a part of a string</p>
<p>slice(start, end) it will take 2 parameters <span><img src="images/sli.jpg" style="width:100%"></span><br/>
substring(start, end) this is similar to slice() but it will not accept negative indexes<br/>
substr(start, length) this is similar to slice() difference is that the second parameter specifies the length of the extracted part. (it will accept negative )</p>
<p><b>Replacing String Content</b></p>
<p>using replace() method replaces a specified value in the string</p>
<span><img src="images/rpl.jpg" style="width:100%"></span>
<p><b>Converting to Upper and Lower Case</b></p>
<p>using toUpperCase() and toLowerCase() method we can convert </p>
<span><img src="images/tol.jpg" style="width:100%"></span>
<p><b>The concat() Method</b></p>
<p>using concat() method joins two or more strings</p>
<span><img src="images/cnc.jpg" style="width:100%"></span>
<p>String.trim() using trim() method we can remove whitespace from both sides of a string</p>
<span><img src="images/tr.jpg" style="width:100%"></span>
<p><b>Converting a String to an Array ****</b></p>
<p>using split() method we can convert string to array</p>
<span><img src="images/ast.jpg" style="width:100%"></span>
<h5>JavaScript Number</h5>
<p>Converting Variables to Numbers</p>
<p>for converting number javascript 3 methods are there<br/> Number() method (can be used to convert JavaScript variables to numbers) <span><img src="images/nu.jpg" style="width:100%"></span><br/>
parseInt() method convert string to number. <span><img src="images/prs.jpg" style="width:100%"></span><br/>
parseFloat() method it is simlar to parseInt method and it will return floated numbers also like (10.33)</p>
<h5>JavaScript Arrays ***</h5>
<p>JavaScript arrays are used to store multiple values in a single variable.</p>
<p>we will create arrays 2ways below </p>
<p>we can access an array element by using index Number</p>
<p>Arrays are a special type of objects. The typeof operator in JavaScript returns "object" for arrays.</p>
<span><img src="images/ar.jpg" style="width:100%"></span>
<p><b>Accessing the First Array Element</b></p>
<p>using index nuber will access if first element in array will use(array[0]) name</p>
<span><img src="images/ft.jpg" style="width:100%"></span>
<p><b>Accessing the Last Array Element</b></p>
<span><img src="images/lt.jpg" style="width:100%"></span>
<p><b>Looping Array Elements</b></p>
<p>using for loop and forEach we can make loop</p>
<p>here will take EX: forEach() function</p>
<span><img src="images/fe.jpg" style="width:100%"></span>
<p><b>Adding Array Elements</b></p>
<p>using push() method and array lenght we can add new element to array</p>
<span><img src="images/pu.jpg" style="width:100%"></span>
<span><img src="images/lgt.jpg" style="width:100%"></span>
<p><b>The Difference Between Arrays and Objects</b></p>
<p>In JavaScript, arrays use numbered indexes. </p>
<p>In JavaScript, objects use named indexes.</p>
<p><b>When to Use Arrays. When to use Objects.</b></p>
<p>when we want the element names to be strings (text) will use objects</p>
<p>when we want the element names to be number (text) will use array</p>
<p><b>How to Recognize an Array OR How do I know if a variable is an array?</b></p>
<p>The typeof operator returns object because a JavaScript array is an object.</p>
<p>*** ES5 Define a new method Array.isArray()</p>
<span><img src="images/is.jpg" style="width:100%"></span>
<p><b>JavaScript Array Methods</b></p>
<p>array methods are toString(), join(), pop(), push(), shift(), unshift(), splice(), slice(), concat()</p>
<p>1) using toString() will convert array to string of(comma separated) array values</p>
<span><img src="images/cc.jpg" style="width:100%"></span>
<p>2) using join() method also joins all array elements into a string.</p>
<span><img src="images/jn.jpg" style="width:100%"></span>
<p>3) using pop() method removes the last element from an array</p>
<span><img src="images/ppo.jpg" style="width:100%"></span>
<p>4) we done above</p>
<p>5) using shift() method removes the first array element and "shifts" all other elements to a lower index.</p>
<span><img src="images/spy.jpg" style="width:100%"></span>
<p>6) using unshift() method adds new elements to the beginning of an array</p>
<span><img src="images/un.jpg" style="width:100%"></span>
<p><b>Splicing an Array</b></p>
<p>splice() method can be used to add new items to an array</p>
<p>in splice method we cane pass parameter like below</p>
<span><img src="images/spl.jpg" style="width:100%"></span>
<p><b>Slicing an Array</b></p>
<p>The slice() method creates a new array. It does not remove any elements from the source array.</p>
<span><img src="images/new.jpg" style="width:100%"></span>
<p>slice() method can take two arguments like slice(1, 3).</p>
<span><img src="images/df.jpg" style="width:100%"></span>
<p><b>Concatenating Arrays</b></p>
<p>using concat() method we can merg arrays it will create new array</p>
<span><img src="images/aaa.jpg" style="width:100%"></span>
<h5>JavaScript Sorting Arrays</h5>
<p>using sort() method sorts an array alphabetically and numbers also</p>
<p>using reverse() method we can sort reverse</p>
<h5>JavaScript Array Iteration Methods</h5>
<p><b>Array.forEach()</b></p>
<p>The forEach() method calls a function (a callback function) once for each array element.</p>
<span><img src="images/ef.jpg" style="width:100%"></span>
<p><b>Array.map()</b></p>
<p>map() method creates a new array by performing a function on each array element</p>
<p>The map() method does not change the original array.</p>
<p>The map() method without value it will not execute the function.</p>
<span><img src="images/map.jpg" style="width:100%"></span>
<p><b>Array.filter()</b></p>
<p>The filter() method creates a new array with array elements that passes a test.</p>
<span><img src="images/flt.jpg" style="width:100%"></span>
<p><b>Array.reduce()</b></p>
<p>The reduce() method runs a function on each array element to produce (reduce it to) a single value.</p>
<p>The reduce() method works from left-to-right in the array. See also reduceRight()..</p>
<p>The reduce() method does not reduce the original array.</p>
<p>it will take 4 parameters</p>
<p>The total (the initial value / previously returned value) <br/>
The item value<br/>
The item index<br/>
The array itself</p>
<span><img src="images/rd.jpg" style="width:100%"></span>
<p><b>Array.indexOf()</b></p>
<p>The indexOf() method searches an array for an element value and returns its position.</p>
<span><img src="images/po.jpg" style="width:100%"></span>
<p>Array.lastIndexOf()</p>
<p>Array.lastIndexOf() is the same as Array.indexOf(), but returns the position of the last occurrence of the specified element.</p>
<span><img src="images/lst.jpg" style="width:100%"></span>
<p><b>Array.find()</b></p>
<p>The find() method returns the value of the first array element that passes a test function.</p>
<span><img src="images/fnd.jpg" style="width:100%"></span>
<p><b>Array.findIndex()</b></p>
<p>The findIndex() method returns the index of the first array element that passes a test function.</p>
<span><img src="images/io.jpg" style="width:100%"></span>
<p><b>Conditional Statements</b></p>
<p><b>if</b>: to specify a block of code to be executed, if a specified condition is true <br/> <b>else</b>: specify a block of code to be executed, if the same condition is false<br/> <b>else if</b> :to specify a new condition to test, if the first condition is false <br/><b>switch</b> : statement to select one of many code blocks to be executed.</p>
<span><img src="images/swu.jpg" style="width:100%"></span>
<h5>Different Kinds of Loops</h5>
<p>for - loops through a block of statement it will excute<br/>
for/in - loops through the properties of an object<br/>
for/of - loops through the values of an iterable object<br/>
while - loops through a block of code while a specified condition is true<br/>
do/while - also loops through a block of code while a specified condition is true</p>
<p>EX: while loop</p>
<p> <span><img src="images/wi.jpg" style="width:100%"></span></p>
<h5>avaScript Regular Expressions</h5>
<p>A regular expression is a sequence of characters that forms a search pattern.</p>
<p>Syntax : /pattern/modifiers;</p>
<h5>avaScript Errors - Throw and Try to Catch</h5>
<p>The <b>try</b> statement lets you test a block of code for errors.<br/>
The <b>catch</b> statement lets you handle the error.<br/>
The <b>throw</b> statement lets you create custom errors.<br/>
The <b>finally</b> statement lets you execute code, after try and catch, regardless of the result.</p>
<p> <span><img src="images/try.jpg" style="width:100%"></span></p>
<h5>What is Hoisting?</h5>
<p>Hoisting is JavaScript's default behavior </p>
<p>variables and function declarations are moved to the top of their scope before code execution.</p>
<p>JavaScript only hoists declarations</p>
<p> <span><img src="images/ho.jpg" style="width:100%"></span></p>
<p>but let or const are not hoisted!</p>
<h5>JavaScript Initializations are Not Hoisted</h5>
<p></p>
<p> <span><img src="images/ui.jpg" style="width:100%"></span></p>
<h5>JavaScript Use Strict</h5>
<p>if we use strict mode code should be executed in "strict mode". </p>
<p>The "use strict" directive was new in ES5.</p>
<p>Strict mode makes it easier to write "secure" JavaScript.</p>
<p>Using a variable, without declaring it, is not allowed</p>
<p> <span><img src="images/st.jpg" style="width:100%"></span></p>
<h5>Arrow Function</h5>
<p>Arrow functions allow us to write shorter function syntax</p>
<p> <span><img src="images/arw.jpg" style="width:100%"></span></p>
<h5>JavaScript Classes (oops concepts) ************</h5>
<p>A class is a type of function, but instead of using the keyword function to initiate it, we use the keyword class, and the properties is assigned inside a constructor() method.</p>
<p>whenever will create class and always add constructor method.</p>
<p>once object is initialize then constructor method is call</p>
<p>Ex: below iam creating car class</p>
<p> <span><img src="images/clsm.jpg" style="width:100%"></span></p>
<h5>promise's and observable's</h5>
<p><span><img src="images/pr.jpg" style="width:100%"></span></p></p>
</div>
<div class="col-lg-6">
<h2> </h2><br/>
<h5>constructor</h5>
<p>The constructor method is special method</p>
<p>The constructor method is special method</p>
<p>for initialize properties will use. once we initialize object it will call</p>
<p> JavaScript will add an invisible and empty constructor method</p>
<h5>Methods</h5>
<p>we can create own methods also now iam creating present without calling that method we can run using initialize object below eX;</p>
<p> <span><img src="images/met.jpg" style="width:100%"></span></p>
<h5>Static Methods</h5>
<p>while using static method we no need to create object direct call by class name</p>
<p> <span><img src="images/stm.jpg" style="width:100%"></span></p>
<p>If you want to use the mycar object inside the static method, you can send it as a parameter:</p>
<h5>Inheritance ********</h5>
<p>To create class inheritance use the extends</p>
<p>using class inheritance will get all the methods from another class</p>
<p> <span><img src="images/sup.jpg" style="width:100%"></span></p>
<p>The super() method refers to the parent class.</p>
<p>super() method we call the parent's constructor method and gets access to the parent's properties and methods.</p>
<h5>Getters and Setters</h5>
<p>It can be smart to use getters and setters for your properties, especially if you want to do something special with the value before returning them, or before you set them.</p>
<p>EX: Getter</p>
<p> <span><img src="images/get.jpg" style="width:100%"></span></p>
<p>The name of the getter/setter method cannot be the same as the name of the property, in this case carname.</p>
<p>EX: setter</p>
<p> <span><img src="images/set.jpg" style="width:100%"></span></p>
<p><b>Hoisting : class declarations are not hoisted</b></p>
<P>so first we need to declare class and use it before class cont declare objects and all</P>
<h5>ES5 New Features</h5>
<p>The "use strict" Directive<br/>
String.trim()<br/>
Array.isArray()<br/>
Array.forEach()<br/>
Array.map()<br/>
Array.filter()<br/>
Array.reduce()<br/>
Array.reduceRight()<br/>
Array.every()<br/>
Array.some()<br/>
Array.indexOf()<br/>
Array.lastIndexOf()<br/>
JSON.parse()<br/>
JSON.stringify()<br/>
Date.now()<br/>
Property Getters and Setters<br/>
New Object Property Methods</p><br/>
<h5>ES6 New Features</h5>
<p> let (The let statement allows you to declare a variable with block scope.)<br/>
const<br/>
Arrow Functions<br/>
Classes<br/>
Default parameter values<br/>
Array.find()<br/>
Array.findIndex()<br/>
Exponentiation (**) (EcmaScript 2016)</p>
<p><b>Array.find()</b></p>
<p>The find() method returns the value of the first array element that passes a test function.</p>
<p> <span><img src="images/fid.jpg" style="width:100%"></span></p>
<p><b>Array.findIndex()</b></p>
<p>The findIndex() method returns the index of the first array element that passes a test function.</p>
<p> <span><img src="images/ind.jpg" style="width:100%"></span></p>
<h5>JavaScript Object Constructors ? </h5>
<p>JavaScript Object Constructors is a function that initialize an object</p>
<p>here we can add a Property to an Object but we cont add propeties to constructor </p>
<p>if we add any proporty to constructor we must add to the constructor function </p>
<p> <span><img src="images/ax.jpg" style="width:100%"></span></p>
<h5>JavaScript Object Prototypes ********</h5>
<p>All JavaScript objects inherit properties and methods from a prototype.</p>
<p>Sometimes we want to add new properties (or methods) to an object constructor..</p>
<p>That time using the prototype we can add new properties to object constructors</p>
<p> <span><img src="images/nep.jpg" style="width:100%"></span></p>
<p>and using the prototype we can add new method to object constructors</p>
<p> <span><img src="images/okl.jpg" style="width:100%"></span></p>
<h5>The JavaScript call() Method</h5>
<p>using call method we call functions with a given this value and arguments provided individually</p>
<p>The call() method is a predefined JavaScript method</p>
<p>it can be used to call a method with an owner object as an argument(parameter)</p>
<p>The call() method takes arguments separately.</p>
<p> <span><img src="images/spd.jpg" style="width:100%"></span></p>
<h5>JavaScript Function Apply</h5>
<p>using call method we apply functions with a given this value and arguments</p>
<p>The apply() method is similar to the call() method</p>
<p>The apply() method takes arguments an array.</p>
<p> <span><img src="images/at.jpg" style="width:100%"></span></p>
<h5>JavaScript Closures</h5>
<p>A closure is a function having access to the parent scope, even after the parent function has closed.</p>
<p> <span><img src="images/clsr.png" style="width:100%"></span></p>
<h5>Event Bubbling or Event Capturing?</h5>
<p>There are two ways of event propagation in the HTML DOM, bubbling and capturing.</p>
<h5> Event bubbling and Event Capturing ?</h5>
<p>when an event fire on the element and then bubble up DOM Tree <b>Means First child and then parent will call. </b><br/>
<span><img style="width:100%" src="images/eb.jpg"></span></p>
Capturing is exactly opposite. First parent node is called and then propagates down towards target element.</p>
<span><img style="width:100%" src="images/ec.jpg"></span></p>
<h5>Creating New HTML Elements dynamically</h5>
<span><img style="width:100%" src="images/pp.png"></span>
<h5>Javascript Cookies</h5>
<p>Cookies are data, stored in small text files</p>
<p>Cookies are data, stored in small text files</p>
<P>When a user visits a web page that time it will stored in a cookie.<br/>
Next time the user visits the page, the cookie "remembers" name.</P>
<p><b>we can create cookie like this<br/>document.cookie = "username=John Smith; expires=Thu, 18 Dec 2013 12:00:00 UTC; path=/";</b></p>
<h5>How AJAX Works</h5>
<p>AJAX is standing for Asynchronous JavaScript and XML and this technology helps us to load data and exchange data with the server without a browser page refresh</p>
<h5>What is AJAX?</h5>
<p>1) An event occurs in a web page </p>
<p>2) The XMLHttpRequest object sends a request to a web server </p>
<p>3) The server processes the request </p>
<p>4) The server sends a response back to the web page </p>
<p>5) The response is read by JavaScript </p>
<p>6) An event occurs in a web page </p>
<p>7) An event occurs in a web page </p>
<span><img style="width:100%" src="images/http.png"></span>
<h5>XMLHttpRequest Object Properties</h5>
<p>onreadystatechange : Defines a function to be called when the readyState property changes</p>
<p>readyState : Holds the status of the XMLHttpRequest.</p>
<p>responseText : Returns the response data as a string.</p>
<p>responseXML : Returns the response data as XML data.</p>
<p>status : Returns the status-number of a request.<br/>200: "OK"<br/>
403: "Forbidden"<br/>
404: "Not Found"</p>
<h5>Send a Request To a Server</h5>
<p>To send a request to a server, we use the open() and send() methods of the XMLHttpRequest object</p>
<p><b>GET/POST Requests </b></p>
<span><img style="width:100%" src="images/det.png"></span>
<span><img style="width:100%" src="images/post.png"></span>
<h5>Javascript JSON</h5>
<p>JavaScript Object Notation.</p>
<p>JSON is a syntax for storing and exchanging data.</p>
<p>JSON is text..</p>
<p>When exchanging data between a browser and a server, the data can only be text. ****** </p>
<p><b>Sending Data</b></p>
<p>we will send data to server json formatter only</p>
<p>if data stored in a JavaScript object, we can covert to thw JSON and send it to server (JSON.stringify using stringfy we can convert to JSON String)</p>
<p><b>Receiving Data</b></p>
<p>Convert a string written in JSON format, into a JavaScript object</p>
<span><img style="width:100%" src="images/okl.png"></span>
<h5>diff/w JSON vs XML </h5>
<p>Both JSON and XML can be used to receive data from a web server.</p>
<span><img style="width:100%" src="images/dlj.png"></span>
<h5>what is Javascript JSONP ?</h5>
<p>Using JSONP we can access cross-domain without worrying </p>
<p>JSONP does not use the XMLHttpRequest object. </p>
<h5>What Is The Use Of <This> Keyword In JavaScript?</h5>
<p>The <this> keyword refers to the current object in the program. It is usually available inside a method for referencing the current variable or current object.</p>
<h5>How Do You Change The Style/Class On Any Element From JavaScript?</h5>
<p>document.getElementById(“input”).style.fontSize = “10”;<br/>
-or-<br/>
document.getElementById(“button”).className = “classname”;</p>
<h5>What Are Different Types Of Popup Boxes Available In JavaScript?</h5>
<p><b>Alert</b> – It just has a <Ok> button to proceed.<br/>
<b>Confirm</b> – It pops up a window showing up <Ok> and <Cancel> buttons.<br/>
<b> Prompt</b> – It gives a dialog asking for user input followed by showing <Ok>/<Cancel> buttons.</p>
<h5>what is the difference between let and var ?</h5>
<p>The main difference is the scope difference</p>
<p>while let can be only available inside the scope it's declared, like in for loop,</p>
<p>var can be accessed outside the loop also</p>
<span><img src="images/var.jpg"></span>
<h5>How to compare 2 arrays in JavaScript? and how you show</h5>
<p>we have to find first arry length and using condition we can copare like below code</p>
<span><img style="width:100%" src="images/2ar.jpg"></span></p>
<h5>What does ajax() method do?</h5>
<p>This method sends an asynchronous http request to the server.</p>
<h5>What does the ajax method load() do?</h5>
<p>The load() method sends an http request to load the html or text content from the server and adds them to the DOM element(s).</p>
<h5>What are the jQuery Ajax Events?</h5>
<p>The jQuery library also includes events which will be fired based on the state of the Ajax request, these are called Ajax events.</p>
<h5>What is JSON Why JSON ?</h5>
<p>JSON: JavaScript Object Notation.</p>
<p>When exchanging data between a browser and a server, the data can only be text</p>
<h5>Is it possible to break JavaScript Code into several lines?</h5>
<p>Breaking within a string statement can be done by the use of a backslash, '\', at the end of the first line</p>
<h5>What are all the looping structures in JavaScript?</h5>
<p>For<br/>
While<br/>
do-while loops</p>
<h5>how to convert string to array ?</h5>
<p>using split we we can convert</p>
<p><span><img style="width:100%" src="images/spte.png"></span></p>
<h5>how to convert array to string ?</h5>
<p>using toString() we we can convert</p>
<p><span><img style="width:100%" src="images/to.png"></span></p>
<h5>how to convert string to object ?</h5>
<p>using JSON.parse() we we can convert</p>
<p><span><img style="width:100%" src="images/oj.png"></span></p>
<h5>Is JavaScript Case Sensitive?</h5>
<p>Yes, Javascript is case-sensitive. But HTML and CSS are not.</p>
<h5>What is the use of Void(0)?</h5>
<p>Void(0) is used to prevent the page from refreshing and parameter "zero" is passed while calling.<br/>
Void(0) is used to call another method without refreshing the page.</p>
<h5>Explain what is pop()method in JavaScript?</h5>
<p>The pop() method is similar as the shift() method but the difference is that the Shift method works at the start of the array. Also the pop() method take the last element off of the given array and returns it. The array on which is called is then altered.
<span><img src="images/pop.jpg"></span></p>
</p>
<!-- <h5>What are the features of JavaScript?</h5>
<p><span><img src="images/far.jpg"></span></p>
<h5>What are the advantages of JavaScript?</h5>
<p><span><img src="images/adv.jpg"></span></p> -->
<h5>What is the difference between ViewState and SessionState?</h5>
<p>'ViewState' is specific to a page in a session.</p>
<p>'SessionState' is specific to user specific data that can be accessed across all pages in the web application.</p>
<h5>What is NaN in JavaScript?</h5>
<p>NaN is a short form of Not a Number. </p>
<h5>how can submit form in javascript ?</h5>
<p> onclick="document.forms[0].submit();</p>
<h5>What is a callback function?</h5>
<p>A callback function is a function passed into another function as an argument.</p>
<span><img src="images/cl.jpg"></span></p>
<h5>What is a callback hell?</h5>
<p>Callback Hell is an anti-pattern with multiple nested callbacks which makes code hard to read and debug when dealing with asynchronous logic. </p>
<span><img src="images/ad.jpg"></span></p>
<h5>pyramid</h5>
<p><span><img src="images/pd.jpg" style="width:100%"></span></p></p>
<p><span><img src="images/tgl.jpg" style="width:100%"></span></p></p>
<h5>single array find dublicate value</h5>
<p>1 method</p>
<p><span><img src="images/dbl.jpg" style="width:100%"></span></p></p>
<p>2 method</p>
<p><span><img src="images/pd2.jpg" style="width:100%"></span></p></p>
<p>3 method</p>
<p><span><img src="images/pd3.jpg" style="width:100%"></span></p></p>
<h5>compare arrays and dublicare value find</h5>
<p><span><img src="images/2at.jpg" style="width:100%"></span></p></p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- end section about us -->
<!-- start section footer -->
<div id="footer" class="text-center">
<div class="container">
<div id="loading" class="tecnologies">
<div class="container">
<img class="lazy" src="images/html5.png" data-original="images/html5.png" height="60">
<img class="lazy" src="images/css3.png" data-original="images/css3.png" height="60">
<img class="lazy" src="images/js5.png" data-original="images/js5.png" height="60">
<img class="lazy" src="images/sass.png" data-original="images/sass.png" height="60">
<img class="lazy" src="images/jquery.png" data-original="images/jquery.png" height="60">
<img class="lazy" src="images/angularjs.png" data-original="images/angularjs.png" height="60">
<img class="lazy" src="images/typescript.png" data-original="images/typescript.png" height="60">
<img class="lazy" src="images/react.png" data-original="images/react.png" height="60">
<img class="lazy" src="images/npm.png" data-original="images/npm.png" height="60">
<img class="lazy" src="images/bower.png" data-original="images/bower.png" height="60">
</div>
</div>
<ul class="list-inline">
<li class="email list-inline-item"><i class="fa fa-envelope" aria-hidden="true"></i> <a href="mailto:rajeshb408@gmail.com" traget="_blank">rajeshb408@gmail.com</a></li>
<li class="list-inline-item"><i class="fa fa-phone"></i> <a href="https://api.whatsapp.com/send?phone=9949598062" traget="_blank">+91 9949598062</a></li>
<li class="website list-inline-item"><i class="fa fa-github"></i> <a href="https://github.com/rajeshbyragoni" target="_blank">github.com/rajeshbyragoni</a></li>
</ul>
<div class="socials-media text-center">
<ul class="list-unstyled">
<li><a href="https://www.linkedin.com/in/rajesh-byragoni-94006670/" target="_blank"><i class="fa fa-linkedin"></i></a></li>
<li><a href="https://www.facebook.com/rajesh.goud.1401" target="_blank"><i class="fa fa-facebook"></i></a></li>
<li><a href="https://github.com/rajeshbyragoni" target="_blank"><i class="fa fa-github"></i></a></li>
<li><a href="mailto:rajeshb408@gmail.com" target="_blank"><i class="fa fa-envelope"></i></a></li>
<li><a href="https://api.whatsapp.com/send?phone=9949598062" target="_blank"><i class="fa fa-whatsapp "></i></a></li>
</ul>
</div>
<p>© Copyrights Rajesh. All rights reserved.</p>
</div>
</div>
<!-- End section footer -->
<!-- JavaScript Libraries -->
<script src="js/jquery.min.js"></script>
<script src="js/jquery-migrate.min.js"></script>
<script src="js/bootstrap.bundle.min.js"></script>
<script src="js/typed.js"></script>
<script src="js/owl.carousel.min.js"></script>
<script src="js/magnific-popup.min.js"></script>
<script src="js/isotope.pkgd.min.js"></script>
<script src="js/jquery.easypiechart.min.js"></script>
<!-- Contact Form JavaScript File -->
<script src="contactform/contactform.js"></script>
<!-- Template Main Javascript File -->
<script src="js/main.js"></script>
<script src="js/skills.js"></script>
<script type="text/javascript">
$(document).ready(function () {
setTimeout(load, 3000);
function load() {
$("#loading").show();
$(window).load(function () {
$('#loading').fadeOut('slow');
});
}
});
</script>
</body>
</html>