Skip to content

Instantly share code, notes, and snippets.

View flaviorl-net's full-sized avatar
🎯
Focusing

Flavio flaviorl-net

🎯
Focusing
  • Itaú Unibanco
  • São Paulo - Brasil
View GitHub Profile
//A função não possui nome, mas está sendo atribuida à uma variável,
//por meio dessa variável podemos utilizar a função.
let funcSoma = function (x, y) { return x + y; }
let total = funcSoma(2, 3);
console.log(total);
//Nesse exemplo, nossa função anonima irá receber outra função como parametro.
let minhaFuncao = function (mensagem, funcao) {
let resultado = funcao();
let saida = `${mensagem}: ${resultado}`;
public class Program
{
public delegate int Calculo(int x, int y);
public static void Main(string[] args)
{
Calculo soma = delegate (int x, int y)
{
return x + y;
};
Calculo subtrair = delegate (int x, int y)
//declaração tradicional
public int Soma(int x, int y)
{
return x + y;
}
//declaração com arrow func
public int Soma(int x, int y) => x + y;
//declaração tradicional
function Soma(x, y) {
return x + y;
}
//declaração com arrow func
let soma = (x, y) => x + y;
string nome = "James";
string saudacao = "Olá " + Nome; //Erro
function ObterDadosCliente()
{
let nome = "James";
function ObterEndereco()
{
return "Rua Washington, 14";
}
return `Olá ${nome} seu endereço atual é ${ObterEndereco()}`;
int factorial(int num);
int main()
{
int result, number;
result = factorial(number);
}
int factorial(int num)
{
public string ObterDadosCliente()
{
string nome = "James";
return nome;
}
public string ObterEndereco()
{
string endereco = "Rua Washington, 14";
return $"Olá {nome} você reside em {endereco}"; //erro.
using System;
namespace ConsoleApp1
{
internal class Program
{
public static void Main(string[] args)
{
ConcreteMediator mediator = new ConcreteMediator();
ConcreteColleague1 colleague1 = new ConcreteColleague1(mediator);
using System;
namespace MediatorConsole
{
class Program
{
static void Main(string[] args)
{
ConcreteMediator mediator = new ConcreteMediator();
ConcreteColleague1 colleague1 = new ConcreteColleague1(mediator);