Code Examples
Examples With Multiple Languages
Multilanguage Code Samples
// Arrow function sampleconst arrowFuncSample = () => {console.log('this is an arrow function example');};
Example With One Language
JavaScript
JavaScript Code SampleJavaScript
// Arrow function sampleconst arrowFuncSample = () => {console.log('this is an arrow function example');};
Java
public class MyClass {public static void main(String[] args) {System.out.println("Hello World");}}
Scala
object HelloWorld {def main(args: Array[String]) {println("Hello, world!")}}
CSharp
CSharp Code SampleC#
using System;namespace HelloWorld {class Starter {static void Main(string[] args) {Console.WriteLine("Hello World!");}}}
cURL
Curl Code SamplecURL
curl --request POST \--url https://api.sendgrid.com/v3/mail/send \--header 'Authorization: Bearer YOUR_API_KEY' \--header 'Content-Type: application/json' \--data '{"personalizations": [{"to": [{"email": "recipient@example.com"}]}],"from": {"email": "sendeexampexample@example.com"},"subject": "Hello, World!","content": [{"type": "text/plain", "value": "Heya!"}]}'
GraphQL
GraphQL Code Samplegraphql
type Person {id: ID!name: String!age: Int}
JSON
{"petType": "Tarantula","name": "Squishy"}
PHP
<!DOCTYPE html><html><head><title>Hello World Example</title></head><body><?phpecho "Hello world!";?></body></html>
Shell
#!/bin/shecho Hello World
TypeScript
function sayHello(name: string) {console.log(`Hello ${name}`);}
YAML
- title: Menupages:- title: Homepath: /home- title: Aboutpath: /about- title: Productspath: /products- title: Contactpath: /contact