I
I
Igorek982021-05-11 00:51:58
css
Igorek98, 2021-05-11 00:51:58

How to pass a function as an argument?

There are functions

function move() {...};
function car(fn) {
 fn();
}

How can we pass a function as an argument to car move?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
A
A person from Kazakhstan, 2018-11-03
@LenovoId

if it is hard to see on RMB and open the picture in a new tab
5bdd0bc40dbc7923511076.png

S
sabirovvlad0, 2018-11-03
@sabirovvlad0

<div class="wrapper new_discount">
add or change it, otherwise it’s not convenient everything is done margin-top: -100px;

R
Rsa97, 2021-05-11
@Igorek98

<?php
function foo() {
    print "Foo\n";
}

function baz($fn) {
    $fn();
}

baz('foo'); // Foo

S
Sergo Zar, 2021-05-11
@Sergomen

car(move);

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question