DEV Community

Dicka Ismaji
Dicka Ismaji

Posted on • Edited on

How to write a code on dev.to

It's a basic how to write code like this

javascript

const showName = (name) => {
  console.log(`Hello ${name}`)
}
Enter fullscreen mode Exit fullscreen mode

and How to do like that ?

just an simple code, write like this



```javascript
function data(){
  echo "make me echo";
}
```


using another language ? just change a


 
```(language name) 
code 
```

 

example PHP

<?php echo "i am php language" ?>
Enter fullscreen mode Exit fullscreen mode

example java

package Myjava
public class Myjava{
  public static void main(String[] args){
     System.out.println("Hello dev.to");
  }
}

Enter fullscreen mode Exit fullscreen mode

using the literal template, the key is on left number 1 button

how to write like that ? just add pre syntax of html before literal template

Thank you for reading this post

write with ❤

Top comments (1)

Collapse
 
dicka88 profile image
Dicka Ismaji

First