Create a Code Template for console.log() in NetBeans

Hello again, how is your Sunday? Great? I hope so.

Today I write a lot of code in JavaScript and have to debug several code so I used the console.log() to see what’s the value contained in a variable I wrote before. I have to write many console.log() on the source code. I’m start looking if there is a code template in NetBeans so I can write console.log() more faster.

I look up the JavaScript code template list from NetBeans 7.0.1 installed on my Linux box and end up with a result there is no such code template for console.log(). So I added the new one for the console.log() by following these steps:

  1. Open the Tools menu from the NetBeans menu bar.
  2. Choose the options.

    Choose the options

    Choose the options

  3. Open the Editor tab and choose the Code Templates tab.

    Open the Editor tab and choose the Code Templates tab

    Open the Editor tab and choose the Code Templates tab

  4. Press New button to add new code template.

    Press New button to add new code template

    Press New button to add new code template

  5. Type the abbreviation of code template in New Code Template dialog box.

    Type the abbreviation of code template in New Code Template dialog box

    Type the abbreviation of code template in New Code Template dialog box

  6. Press OK.
  7. Add the expanded text aka the code template.

    Type the abbreviation of code template in New Code Template dialog box

    Type the abbreviation of code template in New Code Template dialog box

  8. Add the description of code template.

    Add the description of code template.

    Add the description of code template.

  9. Press OK button and it’s done!

To use the code template I just type conlog then press Tab to expand the template. The code template features provided by NetBeans is the feature I frequently use in daily coding.

Enjoy!

2 thoughts on “Create a Code Template for console.log() in NetBeans

  1. Pingback: Code template for post HTML form in NetBeans « Muhammad Ghazali's Online Notes

  2. Pingback: Code template for get HTML form in NetBeans « Muhammad Ghazali's Online Notes

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s