lucastools version info getter
lucastools.lucastoolsINFO();
Here is what the above code is Doing:
1. Importing the lucastools module
2. Creating a lucastools object
3. Calling the lucastoolsINFO() method
lucastools.lucastoolsINFO();
Here is what the above code is Doing:
1. Importing the lucastools module
2. Creating a lucastools object
3. Calling the lucastoolsINFO() method
setTimeout(function(){ console.log(“Ready”) }, 1000); Here is what the above code is Doing: 1. We’re creating a new variable called `browser` and assigning it to a new instance of the `puppeteer` library. 2. We’re telling the `browser` to open a new page. 3. We’re telling the `page` to navigate to the `https://www.google.com` URL. 4. We’re telling…
Here is what the above code is Doing: 1. We’re importing the socket.io library. 2. We’re creating a socket.io client. 3. We’re listening for the ‘message’ event. 4. We’re logging the message to the console. 5. We’re displaying the message in the browser. Now, let’s create a server that will send a message to the…
// https://api.opencagedata.com/geocode/v1/json?q=,&pretty=1&key=API_KEY fetch(“https://api.opencagedata.com/geocode/v1/json?q=52.5,13.4&pretty=1&key=API_KEY”) .then(response => { return response.json(); }) .then( data => { console.log({ data }); }) .catch(err => { console.error(err); }); Here is what the above code is Doing: 1. We’re using the fetch API to make a GET request to the OpenCageData API. 2. We’re passing the latitude and longitude values as query…
constructor(private fb: FormBuilder) { this.myForm = this.fb.group({ options: [‘1’] }) } Here is what the above code is Doing: 1. We are creating a form group with a single form control called options. 2. We are setting the initial value of the form control to 1. 3. We are binding the form group to the…
function firstRepeatingCharacter(str) { for (let i = 0; i < str.length; i++) { if (str.indexOf(str.charAt(i)) !== str.lastIndexOf(str.charAt(i))) { return str.charAt(i) } } return 'no results found' } Here is what the above code is Doing: 1. We loop through the string 2. We check if the index of the current character is not equal to...
function bubbleSort(array) { var done = false; while (!done) { done = true; for (var i = 1; i < array.length; i += 1) { if (array[i - 1] > array[i]) { done = false; var tmp = array[i – 1]; array[i – 1] = array[i]; array[i] = tmp; } } } return array; }…