Ali has Published 39 Articles

What happens when you do not declare a variable in JavaScript?

Ali

Ali

Updated on 13-Jun-2020 09:23:31

228 Views

Yes, this can be done. When you have a global scope, you can use a variable without declaring it. The following “no var” variable “points” will look at the scope chain, wince var keyword isn’t use −                    var rank = ... Read More

What is the use of declaring variables in JavaScript?

Ali

Ali

Updated on 13-Jun-2020 08:27:46

168 Views

Before you use a variable in a JavaScript program, you must declare it. Variables can be thought of as named containers. You can place data into these containers and then refer to the data simply by naming the container.Variables are declared with the var keyword as follows.     You ... Read More

How to declare numbers in JavaScript?

Ali

Ali

Updated on 13-Jun-2020 07:43:55

5K+ Views

JavaScript is untyped language. This means that a JavaScript variable can hold a value of any data type. To declare variables in JavaScript, you need to use the var keyword. Whether it is a number or string, use the var keyword for declaration.Here’s how you can declare numbers in JavaScript −var ... Read More

How and why to avoid global variables in JavaScript?

Ali

Ali

Updated on 13-Jun-2020 07:10:36

1K+ Views

Avoid global variables or minimize the usage of global variables in JavaScript. This is because global variables are easily overwritten by other scripts. Global Variables are not bad and not even a security concern, but it shouldn’t overwrite values of another variable.On the usage of more global variables in our ... Read More

Should I always put my JavaScript file in the head tag of my HTML file?

Ali

Ali

Updated on 13-Jun-2020 06:14:47

430 Views

You can place the tags, containing your JavaScript, anywhere within your web page, but it is normally recommended that you should keep it within the tag or tag.It’s good for performance to add JavaScript in element. Here’s an example to add under … −   ... Read More

Including third party libraries in SAPUI5 Project

Ali

Ali

Updated on 26-Feb-2020 06:20:56

466 Views

You would rather use it like below −jQuery.sap.require("sap.ui.thirdparty.jqueryui.jquery-ui-core");Note that jQuery does not have any security-related documentation on their site, but they are known to be aware of security and usually reacting quickly in case security issues are found within their library.SAPUI5 includes different versions of jQuery together with their own ... Read More

Page build in HTML and wanted to load into JS view in SAPUI5 application.

Ali

Ali

Updated on 25-Feb-2020 11:06:12

544 Views

The most commonly used way of doing this is to embed the HTML page as an iframe. Here is the example.new sap.ui.core.HTML({    preferDOM: true,    content: "" });It can also be loaded using AJAX call or display using sap.ui.core.HTML, but it will depend upon your HTML page.Read More

Create database view in SAP ABAP

Ali

Ali

Updated on 25-Feb-2020 11:00:13

1K+ Views

In ABAP, you can make use of Function modules - DDIF_VIEW_PUT and DDIF_VIEW_ACTIVATE for view activation. All table parameters should be defined correctly otherwise it can result in an error in the creation process.DDIF_VIEW_PUT − Interface for writing a view in the ABAP Dictionary.You can refer to below link for ... Read More

How to check whether element is in the array in Java?

Ali

Ali

Updated on 24-Feb-2020 10:55:45

137 Views

Following example uses Contains method to search a String in the Array.Exampleimport java.util.ArrayList; public class Main {    public static void main(String[] args) {    ArrayList objArray = new ArrayList();    ArrayList objArray2 = new ArrayList();    objArray2.add(0, "common1"); objArray2.add(1, "common2");   objArray2.add(2, "notcommon"); objArray2.add(3, "notcommon1");    objArray.add(0, "common1"); objArray.add(1, ... Read More

How do I reverse an int array in Java

Ali

Ali

Updated on 24-Feb-2020 10:35:31

192 Views

Following program reverses an int array.Examplepublic class Tester {    public static void main(String[] args) {       int[] numbers = {1,2,3,4,5};       //swap the numbers till the midpoint comes       for (int start = 0, end = numbers.length - 1;       start

Advertisements