Knockout - Sample Interview Question (Junior Level)

What will be the displayed near the "Full name:" in the HTML page?


<!-- This is a *view* - HTML markup that defines the appearance of your UI -->
<script type='text/javascript' src='knockout-3.2.0.js'  ></script>
<script type='text/javascript' src="test.js" defer="defer"></script>

<p>First name: <input data-bind="value: firstName" /></p>
<p>Last name: <input data-bind="value: lastName" /></p>

<p>Full name: <strong data-bind="text: fullName"></strong></p>



function AppViewModel() {
    this.firstName = ko.observable("Hello");
    this.lastName = ko.observable("World");

this.fullName = ko.computed(function() {
             return this.firstName() + " " + this.lastName();    
    }, this);

ko.applyBindings(new AppViewModel());

  1. Hello World
  2. An error will occur
  3. World Hello
Tests in Knockout for Juniors

Test Name Difficulty Time (minutes) No. of Questions
Knockout Online Test for Juniors Knockout Junior 20 10