Top "Function" questions

A function (also called a procedure, method, subroutine, or routine) is a portion of code intended to carry out a single, specific task.

Set type for function parameters?

Is there a way to let a javascript function know that a certain parameter is of a certain type? Being …

javascript function
Writing your own square root function

How do you write your own function for finding the most accurate square root of an integer? After googling it, …

algorithm function math square-root newtons-method
how to create and call scalar function in sql server 2008

I have created a Scalar Functions, it was created successfully, but when I call the function using select statement, it …

sql-server-2008 function call scalar
invalid use of non-static member function

I have something like this: class Bar { public: pair<string,string> one; std::vector<string> cars; …

c++ function constants member non-static
Reverse a string without using reversed() or [::-1]?

I came across a strange Codecademy exercise that required a function that would take a string as input and return …

python string function for-loop reverse
How do I write a RGB color value in JavaScript?

I am trying to change the color of the function swapFE() below and I can't figure out how to write …

javascript function coding-style colors rgb
Can you write nested functions in JavaScript?

I am wondering if JavaScript supports writing a function within another function, or nested functions (I read it in a …

javascript function nested
How to create a template function within a class? (C++)

I know it's possible to make a template function: template<typename T> void DoSomeThing(T x){} and it's …

c++ templates function class
How to create javascript delay function

I have a javascript file, and in several places I want to add a small delay, so the script would …

javascript function delay sleep wait
How can you use php in a javascript function

<html> <?php $num = 1; echo $num; ?> <input type="button" name="lol" value="Click to increment" onclick="…

php javascript ajax function client-side