654Find Largest Number in Javascript

Nice way and fast way of finding the largest number in an array.

var arr = [1233, 32, 442];
var largest = Math.max.apply(Math, arr);

http://ejohn.org/blog/fast-javascript-maxmin/

http://stackoverflow.com/questions/1379553/how-might-i-find-the-largest-number-contained-in-a-javascript-array

632Inline Functions in C

The keyword inline, when applied to functions, tells the compiler to optimize calls to the functions. Usually used for short functions and for the sake of clarity.

inline int max(int a, int b) {
    return a + b;
}

int main(void) {
    int x = 2;
    int y = 6;
    printf("result: %d", add(x,y));
}

// ok, the example is stupid, but i hope it illustrates the idea

Looks exactly the same as calling a function, but actually the function is not called, no function-calling overheads are created. Instead the inline function is expanded in place, where it is called. Obviously this only makes sense with rather short functions.