function

Solutions on MaxInterview for function by the best coders in the world

showing results for - "function"
Cliff
28 Nov 2018
1local id = --gamepass id here
2
3game.Players.PlayerAdded:Connect(function(player)
4	if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(player.UserId,id) then
5    	--do what you want to do in here
6    end
7end)
Julia
10 Oct 2016
1function factorial(n) {
2  if (n == 0) {
3    return 1;
4  } else {
5    return factorial(n - 1) * n;
6  }
7}
Jan
01 Feb 2018
1funcion name_of_funtion(){
2
3}
Amy
08 Mar 2019
1function linearSearch(value, list) {
2    let found = false;
3    let position = -1;
4    let index = 0;
5 
6    while(!found && index < list.length) {
7        if(list[index] == value) {
8            found = true;
9            position = index;
10        } else {
11            index += 1;
12        }
13    }
14    return position;
15}
16
Giovanni
14 Jul 2020
1function list_formation(){
2$args = array(,
3
4    'post_type' => 'categories',
5    'posts_per_page' => 20,
6);
7
8$loop = new WP_Query( $args );
9while ( $loop->have_posts() ) : $loop->the_post();
10    
11    $formations = get_posts(array(
12        'post_type' => 'formations',
13        'post__in' => array(16061),
14        'meta_query' => array(
15            array(
16                'key' => 'categories', // name of custom field
17                'value' => '"' . get_the_ID() . '"', 
18                'compare' => 'LIKE'
19            )
20        )
21    ));
22   
23    if($formations){
24
25        foreach ($formations as $categorie){
26           // $list = get_field('formations', $formation->ID);
27           // list of categorie  with ID  formation
28            echo   the_title()  . '</br>';
29
30        }
31
32    }
33endwhile;
34
35wp_reset_postdata();
36
Yohan
24 Mar 2018
1[PHP]
2
3<?php
4function helloWorld() {
5   echo "Hello World";
6}
7
8helloWorld();
9?>
10
11[Python]
12
13def helloWorld():
14  print("Hello World")
15  
16helloWorld()
17
18[JavaScript / JS Normal Function]
19
20function helloWorld() {
21  console.log("Hello World!");
22}
23
24helloWorld()
25
26[JavaScript / JS Dynamic, Arrow Function]
27
28const helloWorld = () => {
29   console.log("Hello World!");
30}
31
32helloWorld()
similar questions
queries leading to this page
function