Posts

Asynchronous -Promise

Image
 

Protractor-Js-Typescript

 1-Protractor is an end-to-end test framework for angular and angularJS applications. Webdriver + angular support = protractor. What language does the protractor support? protractor is a node.js program built on top of WebDriver JS.

some and every function

let zz = [ 11 , 22 , - 33 ]; let allPositve = zz . every ( function (value){ return value >= 0 ; }) console . log ( allPositve ); let somePositve = zz . some ( function (value){ return value >= 0 ; }) console . log ( somePositve ); node sortingarray.js false true

java script Arrays and Objects - FORIN , FOR OF

let aa = [ 12 , 14 , 15 , 16 ]; let bb = [ 22 , 33 , 44 , 55 , 66 ]; for ( aaa in aa ){ console . log ( aaa ); } // let cc= aa.concat(bb); // console.log(cc); // cc.splice(6,1); // console.log(cc); let obj = [{ id : 123 , name : 'sudheer' }, { id : 100723 , name : 'myra' }]; //console.log(obj[0].id); for ( value in obj ){ if ( obj [ value ]. id === 100723 ){ console . log ( 'Found the value ' , obj [ value ]. id ); } else console . log ( 'the value is outside' , obj [ value ]. id ); } indureddy@Bindus-MBP js-basics % node concat.js the value is outside 123 Found the value 100723 bindureddy@Bindus-MBP js-basics % node concat.js 0 1 2 3 the value is outside 123 Found the value 100723 bindureddy@Bindus-MBP js-basics %

Java -Protractor

 Node: Node is used to install 3rd party jars. Primitive Types: strings, numbers,null,undefined,objects primitives are copied by their values. let a=10; let b =a; a=30; console.log(a);//30 console.log(b);10 reference types: Objects Arrays Functions Objects  are copied by their values. let a={value:10} let b =a; a=30; console.log(a);//30 console.log(b);30 the default values of variable in jsavascipt is undefined   Object : let persons = { nameE : 'Kumar' , ageof : 1234 } console . log ( persons . ageof ); console . log ( persons . nameE ); console . log ( persons ); Cloning an Object : Const circle = { aaa : 123 , bbb : 234 , ccc : 'sudheer' } const circle1 = { ... circle }; const circle3 = Object . assign ({ color : 'yellow' }, circle1 ); //console.log(circle); circle . ccc = 345 ; //console.log(circle); //delete circle.ccc; ///console.log(circle); for ( value in circle1 ){ console . log ( circle1 ); } Arrays: let arrayCities...

Strings

  package JavaPra ; public class StingEx { public static void main (String[] args) { String name = "Myra Nirvana" ; System. out .println(name) ; // length of the string System. out .println(name.length()) ; //12 //Concatenate the String String s1 = "Welcome" ; String s2= "to my world" ; //join 2 strings System. out .println(s1+s2) ; System. out .println(s1.concat(s2)) ; String s3= "Automation" ; System. out .println(s1.concat(s2).concat(s3)) ; String s4= " SDET " ; // trim the left and right values System. out .println( "before Trim" +s4) ; s4.trim() ; System. out .println(s4.length()) ; System. out .println( "after Trim" ) ; System. out .println(s4.trim().length()+s4.trim()) ; System. out .println(name.charAt( 7 )) ; for ( int i = 0 ; i < name...

Java programs-Array

 Sort an Array using inbuilt Methods: package JavaPra ; import java.lang.reflect.Array ; import java.util.Arrays ; import java.util.Collections ; public class SortingArray { public static void main (String[] args) { int years[]= { 1988 , 2021 , 1991 , 2025 } ; //approach 1 Arrays. parallelSort (years) ; System. out .println(Arrays. toString (years)) ; int yearsolderst[]= { 1988 , 2021 , 1991 , 2025 } ; System. out .println( "Before Sorting---" +Arrays. toString (yearsolderst)) ; //approach 2--Ascending order Arrays. sort (yearsolderst) ; System. out .println( "After Sorting---" +Arrays. toString (yearsolderst)) ; ////approach 3- decending order Integer Tdates[]= { 1988 , 2021 , 1991 , 2025 } ; Arrays. sort (Tdates , Collections. reverseOrder ()) ; System. out .println(Arrays. toString (Tdates)) ; } } Output [1988, 1991, 2021, 2025] Before Sorting---[1988, ...