11 things about JavaScript functions .NET developers must know: Part 1

I have often seen .NET developers struggle with the JavaScript. They try to compare C# functions with the JavaScript functions and usually do some minor but conceptual mistakes while using it. As we all will agree that JavaScript functions are the backbone of the JavaScript programming language, and if one has good understanding of the function then using JavaScript is easier. So in this two parts series, I will focus some important concepts of JavaScript functions.

In this part of the series, we will cover the following six topics:

  1. JavaScript function as an expression
  2. JavaScript function as a statement
  3. Return statement in the JavaScript function
  4. Parameters in the JavaScript function
  5. Arguments object in the JavaScript function
  6. Varargs JavaScript function

JavaScript functions can be an expression

A JavaScript function can be an expression. You can create a JavaScript function as an expression as shown below:

image

A function expression creates an instance of the function object. It can be passed as an argument to a function, it can be returned from a function, and it can be assigned to a variable or an array. A function expression can be created with the name as shown follows:

Read full article on the Infragistics blog

Getting started with Unit Testing JavaScript using QUnit

It is good to have automated unit tests for the codes while developing. In unit test we test smallest unit of the code for a particular behaviour. The Unit test helps us to find bugs in the code early in the development cycle. Essentially unit test is the piece of code which verifies behaviour of a particular unit of the code in the development phase. Unit tests can be run by the test runner multiple times to verify behaviour of a particular unit of code for different set of input. Now a day’s most of the application development are adhering to Agile and TDD approach. In the test driven development approach, first you write a unit test, it will fail, then write application code to pass the test. Unit testing is not different in JavaScript than other programming languages. To do unit testing or TDD in JavaScript, you need a testing framework. There are many popular JavaScript testing framework available. Some of them are as follows:

  • · Mocha
  • · Jasmine
  • · QUnit
  • · JSUnit

In this article we will focus on QUnit. QUnit is a unit testing framework provided by the jQuery team. It provides a rich set of test assertions, highly informative test suite UI, support of synchronous and asynchronous call back, support of test module etc. In this post we will cover the following topics,

  • Write first unit test
  • Understating the test suite UI
  • A look into the assertions
  • Grouping the tests

Writing the first test

Let us start with setting up the QUnit for the JavaScript unit testing. You need to add reference of the two QUnit files on the HTML page. Either you can have files locally in the project or you can use the reference of the jQuery CDN. I am going to use the CDN option as shows below:

Read full article here on Infragistics blog

Launched Video Blog: Watch to Learn with Dhananjay Kumar

I am excited to announce that, I have started a new video blog

WATCH TO LEARN WITH DHANANJAY KUMAR

clip_image002

On this blog, I will  focus on MEAN stack, C#, Azure, JavaScript etc. To start with I have published 5 episodes. Feel free to provide feedback such that we can together learn better.

I will try to keep Watch to Learn free. However you can support me with the donations. Feel free to subscribe and share.

So let us WATCH TO LEARN WITH DHANANJAY KUMAR  :) :)

Hindi Video : Create Azure based ASP.NET MVC application in 30 minutes

 

Subscribe here to YouTube channel for all episodes

image

Cloud has been a buzz word for a while now. As a developer, we focus on converting the customer requirements to the code and sometimes find ourselves behind with the industry buzz words. The cloud is everywhere and perhaps the future. However as a developer, you won’t have to write very different code for cloud than codes you have been writing for the in-premise applications. In this post, I assume that you are already aware about MVC applications, hence I will focus on demonstrating how building for cloud is not very much different. I will follow step by step approach and create end to end MVC application completely hosted in the cloud (data and application both).

In this article, we will follow the following steps,

  • Setting up the database in the SQL Azure
  • Creating the MVC application
  • Building the application using MVC and the Entity framework
  • Publishing the application to Azure web site

Read full article on Infragistics blog

Subscribe here to YouTube channel for all episodes

 

 

 

 

 

Read article based on this video here

Subscribe here to YouTube channel for all episodes

I hope you like this video. Do not hesitate to leave comment or any feedback. Happy coding.

Discount for my blog readers for video tutorial on WatchMeCode

image

Many of you have asked me recently that how I learn JavaScript and other related stuff. One of the resource, I heavily rely and learn from is WatchMeCode videos by Derick Bailey. I watch videos published here. Clearly videos demonstrate deep understanding of Derick on the subject and certainly you will be benefited by his teaching.

About WatchMeCode

WatchMeCode is a video tutorial site by Derick. He publishes various episodes here. You can find videos on following topics to learn.

clip_image002

As of now there are total 60 episodes and counting. Out of 60, few episodes are free to watch. There are episodes on JavaScript, Node, MongoDB etc. I am sure these episodes from none other than Derick will add lot of values to your learning and in your projects.

Find all episodes here

About Derick Bailey

Derick is a popular author, blogger and JavaScript lover. He blogs at http://derickbailey.com/ and you can follow his tweets at https://twitter.com/derickbailey .

How I can help to get subscription?

WatchMeCode monthly subscription is of $ 14 (roughly 840 RS. Per month). I can help you in getting the subscription in $9(roughly less than 500 RS. Per month). To get the discount coupon send me a mail on debugmode[at]outlook[dot] com or tweet me at https://twitter.com/debug_mode

I would say WatchMeCode worth much more than 500 RS and you must transact 500 RS per month to learn from one of the best in our industry.