The isString() method in AngularJS basically checks if a reference is a string value or not. This method will return True if the reference passed inside the function is a string, else it will return False.Syntaxangular.isString(value)Example − Check if the reference is a String or notCreate a file "isString.html" in your Angular project directory and copy-paste the following code snippet. angular.isString() Welcome to Tutorials Point ... Read More
Suppose we have two numbers a and b. We shall have to define a function that can calculate (a + b) and (a - b) both. But using a function in C, we can return at most one value. To find more than one output, we can use output parameters into function arguments using pointers. Here in this problem we shall update a with a+b and b with a-b. When we call the function we shall have to pass the address of these two variables.So, if the input is like a = 5, b = 8, then the output will ... Read More
Suppose we have two integer numbers a, b and two floating point numbers c, d. We shall have to find the sum of a and b as well as c and d. We also have to find the sum of a and c as well. So depending on the printf function style, output may differ.So, if the input is like a = 5, b = 58 c = 6.32, d = 8.64, then the output will be a + b = 63 c + d = 14.960001 a + c = 11.320000To solve this, we will follow these steps −To ... Read More
Suppose you want to take a character, then a string and a sentence (string with spaces) using C. So we shall provide three inputs and print the same as output. The maximum size of the string is 500 here.So, if the input is likecharacter = 'T' string = "ProgrammingLanguage" sentence = "I love programming through C", then the output will beYour character: T Your string: ProgrammingLanguage Your sentence: I love programming through CTo solve this, we will follow these steps −For character we need to use scanf("%c", &character);For string we need to use scanf("%s", string);This step is optional, but required ... Read More
The isUndefined() method in AngularJS basically checks if a reference is defined or not. This method will return True if the reference passed inside the function is not defined or undefined, else it will return False.Syntaxangular.isUndefined(value)Example − Check if the reference isUndefined or notCreate a file "isUndefined.html.3" in your Angular project directory and copy-paste the following code snippet. angular.isUndefined() Welcome to Tutorials Point AngularJS | ... Read More
The forEach() function in AngularJS uses the Iterator object to iterate over the collection of items or objects or an array. The iterator function is called with the iterator object(value, key, obj) where, value represents the object property or an array element, key specifies the object property key or array element index, andobj represents the whole object.Note that the forEach() function does not iterate over the inherited properties.Syntaxangular.forEach(obj, iterator, [context])Example − Iterate the values using forEach()Create a file "forEach.html" in your Angular project directory and copy-paste the following code snippet. angular.forEach() ... Read More
The ng-change directive in AngularJS evaluates a given expression whenever the user changes the input. On every change, the ngChange directive is fired and the expression is evaluated immediately. The JavaScript onChange event only triggers at the end of a change (when the user leaves the form element or presses the key).Note − This directive also requires ngModel to be present.Syntax..Content..Example − ngChange DirectiveCreate a file "ngChange.html" in your Angular project directory and copy-paste the following code snippet. ngChange Directive ... Read More
The ng-keydown directive in AngularJS basically specifies a custom event on pressing the key. We can perform multiple functions whenever the keydown event is called. This event also supports different types of elements like , and .Syntax..content..Example − ngKeydown DirectiveCreate a file "ngKeydown.html" in your Angular project directory and copy-paste the following code snippet. ngKeydown Directive .keyDown { background-color: blue; color: white; ... Read More
Suppose we have a directed graph with n colored nodes and m different edges. And the nodes are numbered from 0 to n-1. We have a string col with lowercase letters, where col[i] represents the color of the ith node in this graph (0-indexed). We also have an edge list where edges[j] = (u, v) represents, there is an edge between u and v.A valid path in the graph is a sequence of nodes xi for all i from 1 to k, such that there is a directed edge from xi to xi+1. The color of the path is the ... Read More
Suppose we have a list of intervals, where intervals[i] has a pair (left_i, right_i) represents the ith interval starting at left_i and ending at right_i (both inclusive). We also have another array called queries. The answer to the jth query is the size of the smallest interval i such that left_i
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP