-
Description I Have An Array With Type iType On Below Here
interface iType { subject: string, point: number }
const data: iType[] = [ { subject: "IPA", point: 70, }, { subject: "MTK, point: 65 } ];
Can You Find The Value Of The data Above Using Following Formula:
value = total_of_point / total_of_data;
Code export interface iType { subject: string, point: number } export function valueResult (data: iType[]): number { let value = 0; // You Can Code Below Here return value; }
Test Cases Failed // See https://www.chaijs.com for how to use Chai. import { assert } from "chai"; import { valueResult, iType } from "./solution"; const data: iType[] = [ { subject: "IPA", point: 70, }, { subject: "MTK", point: 65 } ]; describe("Checking Test Nagatech Basic #4", function() { it("Checking Test On Array Function", function() { assert.strictEqual(valueResult(data), 67.5) }); });
Output:
-
This comment has been reported as {{ abuseKindText }}.
Show
This comment has been hidden. You can view it now .
This comment can not be viewed.
- |
- Reply
- Edit
- View Solution
- Expand 1 Reply Expand {{ comments?.length }} replies
- Collapse
- Remove
- Remove comment & replies
- Report
{{ fetchSolutionsError }}
Please sign in or sign up to leave a comment.