Core functions Flashcards

1
Q

++

A

Concatenates two values.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

A

Removes specified values from an input value.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

abs

A

Returns the absolute value of a number.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

avg

A

Returns the average of numbers listed in an array.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

ceil

A

Rounds a number up to the nearest whole number.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

contains

A

Returns true if an input contains a given value, false if not.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

daysBetween

A

Returns the number of days between two dates.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

distinctBy

A

Iterates over an array and returns the unique elements in it.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

endsWith

A

Returns true if a string ends with a provided substring, false if not.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

entriesOf

A

Returns an array of key-value pairs that describe the key, value, and any attributes in the input object.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

filter

A

Iterates over an array and applies an expression that returns matching values.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

filterObject

A

Iterates a list of key-value pairs in an object and applies an expression that returns only matching objects, filtering out the rest from the output.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

find

A

Returns indices of an input that match a specified value.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

flatMap

A

Iterates over each item in an array and flattens the results.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

flatten

A

Turns a set of subarrays (such as [ [1,2,3], [4,5,[6]], [], [null] ]) into a single, flattened array (such as [ 1, 2, 3, 4, 5, [6], null ]).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

floor

A

Rounds a number down to the nearest whole number.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

groupBy

A

Returns an object that groups items from an array based on specified criteria, such as an expression or matching selector.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

indexOf

A

Returns the index of the first occurrence of the specified element in this array, or -1 if this list does not contain the element.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

isBlank

A

Returns true if the given string is empty (“”), completely composed of whitespaces, or null. Otherwise, the function returns false.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

isDecimal

A

Returns true if the given number contains a decimal, false if not.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

isEmpty

A

Returns true if the given input value is empty, false if not.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

isEven

A

Returns true if the number or numeric result of a mathematical operation is even, false if not.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

isInteger

A

Returns true if the given number is an integer (which lacks decimals), false if not.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

isLeapYear

A

Returns true if it receives a date for a leap year, false if not.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Q

isOdd

A

Returns true if the number or numeric result of a mathematical operation is odd, false if not.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
26
Q

joinBy

A

Merges an array into a single string value and uses the provided string as a separator between each item in the list.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
27
Q

keysOf

A

Returns an array of keys from key-value pairs within the input object.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
28
Q

lastIndexOf

A

Returns the index of the last occurrence of the specified element in a given array or -1 if the array does not contain the element.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
29
Q

log

A

Without changing the value of the input, log returns the input as a system log. So this makes it very simple to debug your code, because any expression or subexpression can be wrapped with log and the result will be printed out without modifying the result of the expression. The output is going to be printed in application/dw format.

30
Q

lower

A

Returns the provided string in lowercase characters.

31
Q

map

A

iterates over items in an array and outputs the results into a new array.

32
Q

mapObject

A

Iterates over an object using a mapper that acts on keys, values, or indices of that object.

33
Q

match

A

Uses a Java regular expression (regex) to match a string and then separates it into capture groups. Returns the results in an array.

34
Q

matches

A

Checks if an expression matches the entire input string.

35
Q

max

A

Returns the highest Comparable value in an array.

36
Q

maxBy

A

Iterates over an array and returns the highest value of Comparable elements from it.

37
Q

min

A

Returns the lowest Comparable value in an array.

38
Q

minBy

A

Iterates over an array to return the lowest value of comparable elements from it.

39
Q

mod

A

Returns the modulo (the remainder after dividing the dividend by the divisor).

40
Q

namesOf

A

Returns an array of strings with the names of all the keys within the given object.

41
Q

now

A

Returns a DateTime value for the current date and time.

42
Q

onNull

A

Executes a callback function if the preceding expression returns a null value and then replaces the null value with the result of the callback.

43
Q

orderBy

A

Reorders the elements of an input using criteria that acts on selected elements of that input.

44
Q

pluck

A

Useful for mapping an object into an array, pluck iterates over an object and returns an array of keys, values, or indices from the object.

45
Q

pow

A

Raises the value of a base number to the specified power.

46
Q

random

A

Returns a pseudo-random number greater than or equal to 0.0 and less than 1.0.

47
Q

randomInt

A

Returns a pseudo-random whole number from 0 to the specified number (exclusive).

48
Q

read

A

Reads a string or binary and returns parsed content.

49
Q

readUrl

A

Reads a URL, including a classpath-based URL, and returns parsed content. This function works similar to the read function.

50
Q

reduce

A

Applies a reduction expression to the elements in an array.

51
Q

replace

A

Performs string replacement.

52
Q

round

A

Rounds a number up or down to the nearest whole number.

53
Q

scan

A

Returns an array with all of the matches found in an input string.

54
Q

sizeOf

A

Returns the number of elements in an array. It returns 0 if the array is empty.

55
Q

splitBy

A

Splits a string into a string array based on a value that matches part of that string. It filters out the matching part from the returned array.

56
Q

sqrt

A

Returns the square root of a number.

57
Q

startsWith

A

Returns true or false depending on whether the input string starts with a matching prefix.

58
Q

sum

A

Returns the sum of numeric values in an array

59
Q

then

A

This function works as a pipe that passes the value returned from the preceding expression to the next (a callback) only if the value returned by the preceding expression is not null.

60
Q

to

A

Returns a range with the specified boundaries.

61
Q

trim

A

Removes any blank spaces from the beginning and end of a string.

62
Q

typeOf

A

Returns the type of a value.

63
Q

unzip

A

Performs the opposite of zip. It takes an array of arrays as input.

64
Q

upper

A

Returns the provided string in uppercase characters.

65
Q

uuid

A

Returns a v4 UUID using random numbers as the source.

66
Q

valuesOf

A

Returns an array of the values from key-value pairs in an object.

67
Q

with

A

Helper function that specifies a replacement element. This function is used with replace, update or mask to perform data substitutions.

68
Q

write

A

Writes a value as a string or binary in a supported format.

69
Q

xsiType

A

Creates a xsi:type type attribute. This method returns an object, so it must be used with dynamic attributes.

70
Q

zip

A

Merges elements from two arrays into an array of arrays.