Increment (++) Operator in JavaScript

Amit Sharma
Updated on 15-Jun-2020 05:39:26

752 Views

The increment operator increases an integer value by one. Here’s an example where the value of a is incremented twice using the increment operator twiceExampleLive Demo                    var a = 33;          a = ++a;          document.write("++a = ");          result = ++a;          document.write(result);          

Check for Not Defined Variable in JavaScript

Rahul Sharma
Updated on 15-Jun-2020 05:26:32

270 Views

To check a variable is ‘undefined’, you need to check using the following. If the result is “false”, it means the variable is not defined. Here, the variable results in “True” −ExampleLive Demo                    var points = 100;             if(points){                document.write("True");             }else{                document.write("False");             }          

Difference Between var functionName() and function functionName() in JavaScript

Johar Ali
Updated on 15-Jun-2020 05:25:58

369 Views

functionDisplayOne is a function expression, however, functionDisplayTwo is a function declaration. It is defined as soon as its surrounding function is executed.Both the ways are used to declare functions in JavaScript and functionDisplayOne is an anonymous function.Here’s the function expression −functionDisplayOne(); var functionDisplayOne = function() {    console.log("Hello!"); };The following is the function declaration −functionDisplayTwo(); function functionDisplayTwo() {    console.log("Hello!"); }

Generate Random Whole Numbers in JavaScript in a Specific Range

Amit Sharma
Updated on 15-Jun-2020 05:25:14

272 Views

To generate a random number, use the JavaScript Math.random() method. Here set the minimum and maximum value and generate a random number between them as in the following code −ExampleLive Demo                    var max = 6          var min = 2          var random = Math.floor(Math.random() * (max - min + 1)) + min;          document.write(random)          

SAP Associate Level Exam Preparation

Sharon Christine
Updated on 13-Jun-2020 14:45:10

128 Views

First, let me make your core basics clear.When you are referring to SAP ECC, you are referring to SAP ERP Central Component which is more or less equivalent to the prior SAP R3 System.  ABAP does not play any much part over here.But ABAP resides in the kernel of SAP which is referred to SAP BASIS.Speaking about your pointers for referenceHorst Keller - ABAP objects (For ABAP)Help.SAP.com  - (overall SAP)SAP ECC 6.0 Black book Then there are blogs, Q&A, and other online help always available. You can start from anywhere and when you move along, you will discover online assets as ... Read More

Use jQuery wrapAll to Wrap Multiple Elements

Amit D
Updated on 13-Jun-2020 14:41:16

2K+ Views

To wrap multiple elements in jQuery, use the wrapAll() method. The wrapAll( ) method wraps all the elements in the matched set into a single wrapper element.Here is the description of all the parameters used by this method:html − A string of HTML that will be created on the fly and wrapped around each target.ExampleYou can try to run the following code to learn how to use jQuery.wrapAll() method to wrap multiple elements −Live Demo           jQuery wrap() method                              $(document).ready(function() ... Read More

Handling HashMultivalue Error in SAP BO Webi Report

varun
Updated on 13-Jun-2020 14:35:13

2K+ Views

This error occurs when your formula returns more than one value and Webi report doesn’t know how to aggregate those values. This error occurs in below ways:#multivalue in aggregation #multivalue in breaks header or footer #multivalue in section level.Example:Let us say an account number which is associated to more than one order numbers. Your solution will not work and hence you are seeing #MULTIVALUE “Multiple Order Numbers for the same account number”.You can handle this by using an aggregated function as per your requirement like Max(), sum() or avg(). You can also check more details using this link:https://archive.sap.com/discussions/thread/1919325Read More

Format a String Using a Dictionary in Python 3

Rajendra Dharmkar
Updated on 13-Jun-2020 14:27:51

764 Views

You can use dictionaries to interpolate strings. They have a syntax in which you need to provide the key in the parentheses between the % and the conversion character. For example, if you have a float stored in a key 'cost' and want to format it as '$xxxx.xx', then you'll place '$%(cost).2f' at the place you want to display it.Here is an example of using string formatting in dictionaries to interpolate a string and format a number:>>>print('%(language)s has %(number)03d quote types.' % {'language': "Python", "number": 2}) Python has 002 quote types.You can read up more about string formatting and their ... Read More

When Java Runs Faster than C++

Alankritha Ammu
Updated on 13-Jun-2020 14:03:12

125 Views

Following are the areas where Java has proved itself faster than C++.Memory allocation/deallocation: Memory allocation/deallocation is much faster and it is often faster to create a new big array instead of using the cached one.Object instantiation: Memory management done by GC of Java attributes faster object related operations on Java than C++.Multithreading and Synchronization: Modern Java programs makes use of multi-core systems to make synchronization and multithreading much faster operation.JIT has improved a lot over period of time and modern Java program execution now is much faster.String operations are faster by having length. Collection methods are optimized like Array copy.Class loading ... Read More

Why is Java Slower than C++ Programs

Akshaya Akki
Updated on 13-Jun-2020 14:02:33

1K+ Views

Modern Java is quite fast and is comparable to C++ code base but it still takes lot of memory. Slowness of Java programs is primarily because of bad programming practices. But following areas are where Java can be improved.Java libraries are written keeping readability and correctness in mind, not performance.Slow String based operations as Strings are UTF-16 encoded objects and are immutable. So more String are used, more memory is required.Boundary checks on arrays also make its operations bit slow.I/O Stream operations are slow considering synchronization checks on each access.Lacking low level functionality like C also attributes to slowness in ... Read More

Advertisements