Count the number of pixel identified as NDVI from a collection of landsat image

My objective is to count the number of pixel identified as NDVI from a collection of landsat images and convert it to area with a unit of square meters or hectares. Could you Please help me. :(

``````var image = ee.ImageCollection('LANDSAT/LE07/C01/T1_TOA')
.median();

var image = ee.Image(
L7.filterBounds(geometry)
.filterDate('2017-04-01', '2017-07-31')
.sort('CLOUD_COVER')
.first()
);

var clip = image.clipToCollection (aoi);

//Create Bands Variable
var B3_Red = image.select('B3');
var B4_NIR = image.select('B4');

//Calculation of NDVI using Gee Help Methods
var ndvi_palette =
'FFFFFF, CE7E45, DF923D, F1B555, FCD163, 99B718, 74A901, 66A000, 529400,'+
'3E8601, 207401, 056201, 004C00, 023B01, 012E01, 011D01, 011301';

var clip1 = ndvi.clipToCollection(aoi)

var ndvi = image.normalizedDifference(['B4', 'B3']).rename('NDVI');
};

// Test the addNDVI function on a single image.

// Map a function over the Landsat 7 TOA collection to add an NDVI band.
var withNDVI = L7.map(function(image) {
var ndvi = image.normalizedDifference(['B4', 'B3']).rename('NDVI');
});

// Make a "greenest" pixel composite.
var greenest = withNDVI.qualityMosaic('NDVI');

// Display the result.
var visParams = {bands: ['B4', 'B3', 'B2'], max: 0.3};

// Create a chart.
var chart = ui.Chart.image.series({
imageCollection: withNDVI.select('NDVI'),
region: aoi,
reducer: ee.Reducer.mean(),
scale: 30
}).setOptions({title: 'NDVI over time'});

// Display the chart in the console.
print(chart);

var cloudlessNDVI = L7.map(function(image) {
// Get a cloud score in [0, 100].
var cloud = ee.Algorithms.Landsat.simpleCloudScore(image).select('cloud');

// Create a mask of cloudy pixels from an arbitrary threshold.

// Compute NDVI.
var ndvi = image.normalizedDifference(['B4', 'B3']).rename('NDVI');

// Return the masked image with an NDVI band.